FAQ Database Discussion Community


Zip fails after PHP download

php,bash,unzip
I am creating a PHP service where a user can download external ZIP files from another server to the server with the PHP. After download I keep getting this ZIP error stating that the file was corrupt / multi-part. That's not the case. I can't extract it on the linux...

Extracting a zip file containing a jar file in Java

java,jar,zip,unzip
I want to extract a zip file which contains a jar file. This file has complex folder structure and in one of the folders there is a jar file. When I am trying to use the following code to extract the jar file the program goes in infinite loop in...

How to know if the zip file is ready to be unzipped after pushing it with adb

android,file,unzip
I want to push a zip file to my android device using adb push myfile.zip /data/ and then to programmatically unzip it in my app. Is there a way to make sure myfile.zip has finished downloading into /data/ before I unzip it? File file = new File("/data/myfile.zip"); if(file.exists()) unzip(); This...

Can't curl then unzip zip file

bash,unzip
I'm just trying to curl this zip file, then unzip it curl -sS https://www.kaggle.com/c/word2vec-nlp-tutorial/download/labeledTrainData.tsv.zip > labeledTrainData.tsv.zip unzip labeledTrainData.tsv.zip labeledTrainData.tsv but I keep getting the error; Archive: labeledTrainData.tsv.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter...

Linux command (unzip -p) run with exec-maven-plugin

maven,command-line,maven-3,unzip,exec-maven-plugin
I have my.zip file under project’s target/ folder. MyProject/ -target/ -my.zip -pom.xml Inside my.zip there is a file named names.txt. If I run linux command under project root: unzip -p target/my.zip names.txt > target/names.txt I successfully get the names.txt extracted to target/ folder: MyProject/ -target/ -my.zip -names.txt -pom.xml I want...

Unzip zip files in folders and subfolders with python

python,unzip
I try to unzip 150 zip files. All the zip files as different names, and they all spread in one big folder that divided to a lot of sub folders and sub sub folders.i want to extract each archive to separate folder with the same name as the original zip...

Powershell ParentContainsErrorRecordException on shell namespace

shell,powershell,unzip
I'm trying to write an unzip powershell script, but I'm running into issues with the $shell.NameSpace() function. function unzip ($sourceFile, $destination){ $shell = new-object -com shell.application $zip = $shell.NameSpace($sourceFile) foreach($item in $zip.items()){ $shell.Namespace($destination).copyhere($item) #Error here } } unzip "$PWD\folder.zip" $PWD When I run this, I get an error on the...

How to unzip a zip file using scala?

excel,scala,unzip
Basically I need to unzip a .zip file which contains a folder called modeled which in turn contains a number of excel files. I have had some luck in finding code that was already written (ZipArchive) which is meant to unzip the zip file, but I cannot figure out why...

A simple Script to extracting a zip file

python,unzip,zipfile,xbmc,kodi
Good Evening all, I think I'm not understanding the zipfile structure properly heres the code import xbmc import zipfile targetzip = xbmc.translatePath('special://home/userdata/addon_data/plugin.program.tester/test.zip') extractto = xbmc.translatePath('special://home/userdata/addon_data/plugin.program.tester/') zip = ZipFile(targetzip) zip.extractall(extractto) Any Ideas why Its not working?...

How to check file size before opening in R

r,download,unzip,filesize
How can I check the size of a file before I load it into R? For example: http://math.ucdenver.edu/RTutorial/titanic.txt I'd like to use the optimal command to open a file based on the file's size....

cannot call a method on a null-valued expression - how to solve it

windows,powershell,unzip
I have written a script that gets the zip file from a specific folder and unzip the file to a specific folder. please check the below codes $shell_app=new-object -com shell.application $zip_file = $shell_app.namespace("C:\Users\jhnayak\Views_Seagate\jhnayak_DDTools_Phase14_Dev\apps\ddcli\build\win\\..\\..\\..\\..\sas2_rel\mptlib2_rel\mptlib2_rel.zip") $destination = $shell_app.namespace("C:\Users\jhnayak\Views_Seagate\jhnayak_DDTools_Phase14_Dev\apps\ddcli\build\win\\..\\..\\..\\..\sas2_rel\mptlib2_rel")...

command line not working when run from vba

vba,command-prompt,unzip
I'm trying to unzip a file via my VBA code. I'm using 7z command line to unzip the file. However the command works when run from normal command prompt but the same command is not working when run via VBA code. Command: "C:\Program Files\7-Zip\7z.exe" x "C:\Users\Public\AppData\Local\Temp\Sample.zip" For further understanding, I'm...

Progress bar not updating on Android

java,android,progress-bar,unzip
I found an excellent UnZip class with progress bar support for Android. However the progress bar does not update when clicking extract in my app. The Unzipping works fine. Can someone please tell me what I am doing wrong? public class UnZip1 extends AsyncTask<Void, Integer, Integer> { { } private...

Howto unzip a big zip file containing one file and get the progress in bytes with swift?

ios,swift,streaming,unzip
I try to unzip a big zip file containing only one file (more then 100MB) and like to show the progress during unzipping. I found solutions, which the progress can be determined based on the amount of files unzipped. But in my case I have only one big file. So...

Pretty recursive directory and file print

linux,find,unzip
I am building a JAVA app that saves the output of bash commands into a list. @root ~/a $ zipinfo -1 data.zip a.txt b.txt test/ test/c.txt root@ ~/a $ find . . ./test ./test/c.txt ./b.txt ./data.zip ./a.txt The idea is to compare files and directories from the zip to what...

I want to extract all .zip files in a given directory in temp using powershell

powershell,unzip
I wrote the following code for extracting the .zip files to temp: function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach ($item in $zip.items()) { $shell.Namespace($destination).copyhere($item) } } Expand-ZIPFile -file "*.zip" -destination "C:\temp\CAP" But I got the following error: PS C:\Users\v-kamoti\Desktop\CAP> function Expand-ZIPFile($file, $destination) { $shell...

Having issues unzipping a .tgz file

file,terminal,directory,unzip
Trying to open a zipped file with a .tgz extension in the desktop, tried opening with archive utility and am being told 'unable to expand into desktop' error 1 - operation not permitted. When i try to unzip the file in terminal it says it cannot be found. No idea...

Unzip files that begin with a particular string

vbscript,wildcard,unzip
This is my second attempt at cracking this problem I am facing. In a nutshell I get some files sent to me on a weekly basis which begin with the same 11 characters and anything after that can differ from week to week. I have some basic code that unzips...

SML - Unzip tuples in one list

list,tuples,sml,unzip
I need to "unzip" a list of tuples and even though I tried with the unzip function it doesn't do what I want to. In fact, as I understood the unzip function returns you a tuple of list, but what i want is this. Giving a list of tuple like...

How to use ant unjar file from a jar into a specific directory without path from jar

ant,filepath,unzip,unjar
I want to copy files from within a jar to a specific directory without preserving the path in the jar. I can use unjar to find just the files I want from the jar OK: <unjar dest="some_dest_path" overwrite="true" src="somejar.jar"> <patternset> <include name="somepath_in_jar/somefile.ext" /> </patternset> </unjar> but the somefile gets extracted...

How to get single file from zip file?

vb.net,extract,unzip
I want to get just one file from .zip file in VB.NET. I don't need to extract all of .zip file, just one file. I'm working with framework 4.5....

ant unzip task: Why does it not fail, if unzipping fails?

ant,groovy,unzip
I use the groovy AntBuilder in a custom written installer, eg. to unpack the installation package. One thing I cannot figure out, is how to detect, whether the unzip task failed, eg. I have the following code: ... AntBuilder antBuilder = new AntBuilder() antBuilder.mkdir(dir:installationPath) antBuilder.unzip(src:zipFileName, dest:installationPath,overwrite:"yes") ... If the destination...

Cannot extract the executable file from zip archieve in Mac

java,osx,unzip
I want to extract Unix executable file from zip archieve. It works properly on Windows but does not work on Mac. My code downloads the zip file and extracts it into specific location. It does extract the file but the file is executable file and it extracts it as a...

Unzipping A file in vb

vb.net,unzip,shell32
I get exception when I try to unzip a file When I remove the try I receive: Additional information: Object reference not set to an instance of an object. Try Dim sc As New Shell32.Shell() ' 'Create directory in which you will unzip your files . ' IO.Directory.CreateDirectory(Application.StartupPath & "/Packs/SkyNet/mods")...