zipfile

Why my decompress class don't make directories?

眉间皱痕 提交于 2019-12-12 05:02:08
问题 I have a class to decompress files, it works fine when the zip doesn't have any folder inside. If it does then it just throw errors. Hers my class: public class Decompress { private String _zipFile; private String _location; ZipEntry ze = null; public Decompress(String zipFile, String location) { _zipFile = zipFile; _location = location; _dirChecker(""); } public void unzip() { try { FileInputStream fin = new FileInputStream(_zipFile); ZipInputStream zin = new ZipInputStream(fin); while ((ze

Using Delphi Toyko creating a Zip file onprocess example

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:57:08
问题 I am trying to create a zip file with Delphi Tokyo using the command ZipDirectoryContents which has 4 parameters. They are ZipDirectoryContents(const ZipFileName: string; const Path: string; Compression: TZipCompression = zcDeflate; ZipProgress: TZipProgressEvent = nil); static; Is there someone who can tell me how to use these parameters especially the TZipProgressEvent to show the progress of the zip file as it is adding the files from the directory. Thanks 回答1: Here is the answer provided

Compress separately files within subfolders

穿精又带淫゛_ 提交于 2019-12-12 03:33:51
问题 Hi all and thanks for the answers, Firstly, I tried to find the answer to my problem but I did not find anything. I have a tree of folders and sub-folders and I want to use 7zip to compress the files within those folders separately. I have got this piece of code from this very website, it does what I want to get but it places the compressed files on the main folder: set extension=.* for /R %%a in (*%extension%) do "%sevenzip%" a -mx "%%~na.zip" "%%a" I wonder if I can get a zip file of every

CSV Should Return Strings, Not Bytes Error

孤街醉人 提交于 2019-12-12 03:28:30
问题 I am trying to read CSV files from a directory that is not in the same directory as my Python script. Additionally the CSV files are stored in ZIP folders that have the exact same names (the only difference being one ends with .zip and the other is a .csv). Currently I am using Python's zipfile and csv libraries to open and get the data from the files, however I am getting the error: Traceback (most recent call last): File "write_pricing_data.py", line 13, in <module> for row in reader: _csv

How to go from spring mvc multipartfile into zipinputstream

随声附和 提交于 2019-12-12 03:00:23
问题 I have a Spring MVC controller that accepts a MultipartFile, which will be a zip file. The problem is I can't seem to go from that to a ZipInputStream or ZipFile, so that I can go through the entries. It either closes the stream prematurely, produces an empty file, or as in the case below, zipInputStream.getNextEntry() returning null. This is my MVC controller: @RequestMapping(value = "/content/general-import", method = RequestMethod.POST) public ModelAndView handleGeneralUpload(

There is no file in Zip but when extract zip, there are files in it

有些话、适合烂在心里 提交于 2019-12-11 16:40:06
问题 I searched for the problem everywhere but I didn't find similar problem. I create a zip file with the following code. The capacity of the zip file seems to be normal as it has file. I can see the files in my zip when I double click it. But when I extract the zip file, I see that the files have been added in two different directories and my files too. Let me explain in more detail below. $files = array( 'bauhaus93regular-1519481745.382.ttf' => '../../../files/task_files/bauhaus93regular

Unzipping Multiple Files - Java

百般思念 提交于 2019-12-11 13:44:09
问题 I'm working on an auto updater for a game client and I've run into an issue. What I need it to do: Download cache.zip and client.zip. Extract cache.zip to cacheDir and extract client.zip to the same location they are running the jar(game). What it does right now: Downloads both cache.zip and client.zip. Extracts cache.zip to the correct location, but also to the location the jar is at. It doesn't extract client.zip at all. 回答1: I use this function to unzip a file: public static void unzip

How to create Zip file and download in CakePhp?

China☆狼群 提交于 2019-12-11 12:18:13
问题 I'm trying to create zip files using CakePhp 1.3. The file descriptions are stored in database. In my controller I'm using the following logic. // Fetching File description form database. $this->view = 'Media'; $user_id=$this->Session->read('userData.User.id'); $condition = "Document.isdeleted = '0' AND Document.project_id='". $project_id."'"; $projectDocumentList = $this->Document->find("all",array('conditions'=>$condition,'fields'=>array('Document.id','Document.document_name','Document.path

Zip files using VB Script with out sleep

扶醉桌前 提交于 2019-12-11 12:10:01
问题 I'd like to know if there is anyway of zipping files using vbscript without using WScript.Sleep. Following is my script(Utility methods are skipped); Sub Main Dim Path Dim ZipFile Dim objShell ZipFile = WScript.Arguments(0) Path = WScript.Arguments(1) Dim a: a = ListDir(Path) If UBound(a) = -1 then WScript.Echo "No files found." Exit Sub End If CreateObject("Scripting.FileSystemObject").CreateTextFile(ZipFile, True).Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar) Set objShell =

How to open password protected zip file in Python 3

拟墨画扇 提交于 2019-12-11 10:48:58
问题 I'm trying to open a password protected zip file in Python. However, I'm completely stuck! I've gone through the python documentation on zip files, but I can't find anything for opening one that is password protected. Could someone please point me in the right direction? path = "some_file.zip" password = "example123" # How do I add the password parameter? ZipFile.extractall(path) 回答1: From https://docs.python.org/2/library/zipfile.html: ZipFile.extractall([path[, members[, pwd]]]) Extract all