FAQ Database Discussion Community


Need a shell script that bzip2's every single file recursively from a certain folder

linux,bash,shell,scripting,zip
I know that this is really not my strong side to write those scripts. I need a shell script which recursively packs every single file in its folder into the .bz2 format because I have a lot of files and when I do this manually it takes me hours. For...

How to convert content of .gz files to lowercase

linux,zip
I have many .gz files and i need to convert the content of these files to all lowercase. I tried: tr '[:upper:]' '[:lower:]' < input.gz > output.gz but when I zcat "output.gz" I get this error: zcat: output.gz: invalid compressed data--format violated I also tried: dd if=input.gz | gzip -c9...

Unzip the archive with more than one entry

linux,curl,zip,pipe,archive
I'm trying to decompress ~8GB .zip file piped from curl command. Everything I have tried is being interrupted at <1GB and returns a message: ... has more than one entry--rest ignored I've tried: funzip, gunzip, gzip -d, zcat, ... also with different arguments - all end up in the above...

How to call HTML file with css, js and images?

javascript,html,ios,zip,nsurl
I am downloading zip file from server. In NSCachesDirectory I have the html file and I would like to know how to run html file with their source files, I have pasted my code. please help me NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString *documentsPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"/Lesson-file/Lesson%d",[str_lsn_id...

ZipUtil Java not zipping same as zip command

java,zip
I am trying to upload a zip file to a server. When I manually zip the file from the command line using zip -r output.zip path/to/folder the upload works fine. However from java when I use ZipUtil.pack(new File("path/to/folder"), new File("output.zip")); I get a server error. I'm wondering why this could...

django open a zip file for user to download

python,django,download,zip
Django 1.7, Python 3.4, windows apache 2.4.12 + wsgi In my program, I generate some csv files and put them in a zip file. I would like to let the user download the zip file, either force download (after file is generated and render response) or a click of button...

zip, sorted and pandas

python,python-2.7,pandas,zip
I have a pandas data frame with column values as follows : names = wine_df.columns names Index([u'fixed acidity', u'volatile acidity', u'citric acid', u'residual sugar', u'chlorides', u'free sulfur dioxide', u'total sulfur dioxide', u'density', u'pH', u'sulphates', u'alcohol'], dtype='object') I have a numpy array named imp with following values: array([ 0.07640909, 0.11346059, 0.09160943,...

PHP Mail() Failed to send email with attachment

php,zip,ziparchive
I'm attempting to create a zip of images, then send the email and attach the .zip file to the user. However, the email is not sending. I'm using mail() elsewhere on the server so I know the server isn't blocking this function. if( (mysqli_num_rows($gallery_query) >= 1) || ($_SESSION['permission'] == 1)...

Zip Archive: Can I rename or move a ZipArchiveEntry? [closed]

c#,.net,zip
Does the .NET ZipArchive allow to rename or move entries? Currently it's not possible to change the name of a ZipArchiveEntry once it is created. It seems that I have to copy the stream of the original ZipArchiveEntry to a newly ZipArchiveEntry with the changed name. Thanks Martin...

zlib inflate returning a buffer error

c++,zip,gzip,zlib,inflate
I'm trying to decompress a zip file using zlib (without using any extension or 3rd party). Initially, the src_len is 48756255, and the dest_len is 49209890. The first pass in the while loop is fine: err is Z_OK and the second pass through starts. On the second pass, no matter...

Uploading a zip file directly to AWS S3 using Python urllib2

python,amazon-s3,zip,urllib2,python-unicode
I am trying to upload a zip file directly to S3 using a Python script, but running into some Unicode Decode Errors. What I do is generate a Pre-Signed S3 Link and then upload data to it. I know the link works fine because the upload works when I use...

Effective way to search ZIP for an XML file with hashed name

java,xml,hash,zip
I have a zip file, which contains lots of folders and XML files and I want to select a specific file. But the file's name is hashed so I can't really tell what it might be, because it's generated by other application. Is there some effective way to select this...

Zipping files with ZipOutputStream gives inconsistent results

java,zip
I want to zip a text file using the java.util.ZipOutputStream class. I found two examples on the internet explaining on how to do that. This led me to the two possible implementations shown below. While both methods produce 'healthy zip files', my problem is that on every run the binary...

Why does map work like izip_longest with fill=None?

python,dictionary,zip
When map has different-length inputs, a fill value of None is used for the missing inputs: >>> x = [[1,2,3,4],[5,6]] >>> map(lambda *x:x, *x) [(1, 5), (2, 6), (3, None), (4, None)] This is the same behavior as: >>> import itertools >>> list(itertools.izip_longest(*x)) [(1, 5), (2, 6), (3, None), (4,...

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...

Remove .svn files from zip file

linux,unix,svn,command-line,zip
I would like to remove all svn directories from a zip file. Can not find correct pattern. This is the pattern I tried ".svn/*" Was able to remove all .class files.

Creating a zip and zip->close() returns false despite checks, path names are correct

php,zip
I've been trying to create a Zip file using PHP and the ZipArchive, but despite checking that each file I add is readable, writable, and exists, zip->close() returns false. If I call zip->numFiles, it returns the number I suspect, but file_exists($zipname) still returns false. Immediately after adding a file, $zip->getStatusString()...

Decompressing text in C#

c#,zip,gzip,decompression
I have an issue which I am banging my head against, I am trying to decompress text in this format: eJx7v3t/QWJxcXl+UQoAJ94F3Q== The problem I am having is that it works awesome on this site: http://www.unit-conversion.info/texttools/compress/ But I can't seem to get it to work with C#, I have tried Gzip...

how can make simple List in scala?

list,scala,dictionary,zip
i know zip can compose two list to one list, scala> List(1, 2, 3).zip(List("4", "5", "6")) res0: List[(Int, Int)] = List((1,4), (2,5), (3,6)) however, the 'res0' is not i want. i want this, res0: List[Int] = List(1,4,2,5,3,6) maybe i should use some 'indexOF' or 'zipWithIndex' but it seems like a...

Node: zlib.gunzip works, but not zlib.inflate?

javascript,node.js,compression,zip,zlib
Why is it that GZIP files I upload can be decompressed fine with zlib.gunzip(), but ZIP files uploaded result in an [Error: incorrect header check] errno: -3, code: 'Z_DATA_ERROR' error from zlib.inflate(), using the following code? if (req.body.compression == 'GZIP') { zlib.gunzip(body, function(err, dezipped) { if (typeof dezipped != 'undefined')...

Zipfile not writing data - Python

python,logging,zip,zipfile
I have tried to zip log files that I have created, but nothing is written! Code: def del_files(): '''Adapted from answer @ http://stackoverflow.com/questions/7217196/python-delete-old-files by jterrace''' dir_to_search = os.path.join(os.getcwd(),'log') for dirpath, dirnames, filenames in os.walk(dir_to_search): for file in filenames: curpath = os.path.join(dirpath, file) log(curpath) if curpath != path: log("Archiving old log...

Out of Memory Exception Ionic Zip Extraction

c#-4.0,zip
I am download a large zip file and trying to extract its contents (a csv file) into a memory stream. This works for smaller files but for larger ones (mine is currently 16mb) I get OutOfMemoryException. So at this point I have the memory stream which consists of the zip...

Zip file encryption readable by some Zip clients, not others

objective-c,zip,zlib
I'm investigating a bug report on my open source UnzipKit project. Basically, when writing files encrypted with a password to a Zip file, the resulting archives are readable by some Zip clients, and not others. UnzipKit writes the password as a UTF-8 string, using the MiniZip wrapper around zlib, which...

Executing WinZip Command in a C# Program

c#,.net,asp.net-mvc,zip,winzip
How to execute winzip command from MVC controller Action? Command: C:\Program Files (x86)\WinZip>WZZIP.EXE -ys2048000 Location Location ...

zip-file to buffer c++

c++,visual-studio-2013,zip
I have to read a dat-file byte by byte from a zip-file in a char[] buffer. The zip-file contains only one dat-file. I guess unzip chunk by chunk would be good. I am using Visual Studio 2013 with c++. I have found zip-utils (http://www.codeproject.com/Articles/7530/Zip-Utils-clean-elegant-simple-C-Win), would this be ok, because its...

Automated zip process sometimes skips files

c#,zip,7zip
Part of my application exports data in a series of CSV files, adds a cover note and then packs all this data into a password protected zip file, ready for dispatch. Here's the relevant code that does the zipping. private bool ZipFiles(string zipfile, string filename, string password) { string arguments...

Create ZipArchive from XML with base64 encoded content

c#,asp.net,zip,linq-to-xml
I am creating an XML file on the fly. One of it's nodes contains a ZIP file encoded as a BASE64 string. I then create another ZIP file. I add this XML file and a few other JPEG files. I output the file to the browser. I am unable to...

Traverse directory and zip certain subdirectories in place

bash,zip,subfolder
How can I bulk-zip folders in subdirectories without including the parent folder in the zip archives? I have a folder structure like this: folder01 folder02 file01 file02 When I run: find . -type d -name "folder02" -exec zip -r '{}'.zip '{}' \; I get "folder02.zip" which always extracts its contents...

I have two lists. I would like to make a third from the elements given in one of the lists

python,list,for-loop,zip
Sorry for the confusing title! I have two lists, say: a = [30,55,76,43,27,28] b = [0,2,3,5] I want to make a list c that is both elements of a, i.e. c = [30,76,43,28] # -> the 0th, 2nd, 3rd, 5th elements of a Should I use the zip() function? Or...

Git check compare is slow

git,github,zip
I am currently working on a project that has a directory with a lot of small files within it that don't change. I know that I can add it to the git ignore but I still want them in my repo. Will zipping the directory shorten the time it takes...

Delete directory in java is not deleting directory

java,zip
I am deleting diretory after zipped the same. I used the following code to make zip and delete. I am able to do zip and cant delete the folder. Can anyone point me where I am doing mistake. Here the code I m using public class ZipDirectory { public static...

How to create zip file in stages?

c#,zip,gzip
I'm writing data into ZIP file in a following way: private static void ZipStringToFile(string value) { using (MemoryStream ms = new MemoryStream()) { using (GZipStream compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true)) { byte[] queryData = _encUtf8.GetBytes(value); compressedzipStream.Write(queryData, 0, queryData.Length); compressedzipStream.Write(_dataEndOfLine, 0, _dataEndOfLine.Length); } using (FileStream outfile = new FileStream("TestZip.zip", FileMode.Append))...

encoding filenames in zip archive to correct displaying in windows explorer

javascript,character-encoding,zip,windows-explorer
On our site we generate zip archives on client side with jszip library. Files in this archive has nonASCII (cyrillic) characters in filenames. If use 7zip filenames displaying correctly. But some users of our site opened this zip archives with windows explorer and in this case file names displayed incorrectly....

Decode a proprietary audio package format into mp3 file using bash

xml,bash,zip
I have a proprietary packaged file that is provided in the form of a .zip. The contents of these files always follows the same structure. In the root folder is an XML file (playlist) that lists the folders containing audio files. Example: <playlist> <playlistversion>1.0</playlistversion> <item>daudio\localaudio\Q2013\0989\0001\</item> <item>daudio\localaudio\Q2013\0989\0002\</item> <item>daudio\localaudio\Q2013\0989\0003\</item> <item>daudio\localaudio\Q2013\0989\0004\</item>...

Can emacs show an image in a zip archieve file in org-mode

image,emacs,zip,archive,org-mode
In emacs org-mode with iimage-mode enabled, it can show an inline image from a relative file path, like: [[file:images/foo.jpg]] What I want is: how can it shows an image locates in an zip archive, like this: [[file:images.zip/foo.jpg]] Is there a way to do this?...

Show extracting a .zip file progress Python Tkinter ProgressBar

python,tkinter,zip,progress-bar,ttk
I am working on a program that extracts a zip file which I have that part worked out. But I want to add a progress bar to show the progress of the extraction process. I already have a progress bar but it does not show the progress of the extraction....

How add a file to an existing zip file using Golang

go,zip
We can create a zip new file and add files using Go Language. But, how to add a new file with existing zip file using GoLang? If we can use Create function, how to get the zip.writer reference? Bit confused....

cannot create a zip with a pdf C#/ASP

c#,asp.net,pdf,zip
I am grabbing my data from the database, converting it, trying to zip it up and return it to the user. I can create a zip file successfully for both txt and docx files, but if I try to use a pdf or zip file it fails and says file...

XmlDocument fails to load stream from ZipArchive entry

c#,xml,zip
I have a zip file that contains an XML file. Using the System.IO.Compression ZipArchive I open the XML file as a Stream (actually a DeflateStream): Stream xmlStream = null; using (ZipArchive archive = ZipFile.Open(destPath, ZipArchiveMode.Read)) { xmlStream = archive.GetEntry(fileNameXml).Open(); } Now I can read from the stream using the Stream.Read...

How do I extract a file with the python zipfile library while changing it's name

python,zip,zipfile
This is motivated by pathfile issues (unfortunately this doesn't seem to be true in my case). I have a zipfile that I am trying to extract with python. The zipfile appears to have been created on windows. The code I have to extract the files from the zipfile is like...

Compress files in a directory in a zip file with the shell

linux,shell,zip
I want to compress files from the filesystem to a directory within a new zip archive or update an old one. So here is my example: directory/ |-file1.ext |-file2.ext |-file3.ext in the zip archive it should look like this: new_directory/ |-file1.ext |-file2.ext |-file3.ext I could copy the files to a...

ZipArchive PHP: Close() returns false with no error message

php,arrays,zip,ziparchive
I'm trying to create a zip file with directory tree based on array strutucture. I already use this answer when I need to create a zip file from a directory tree, but in this case all the files are in the same directory and the directory tree is based on...

Powershell scrip to list Zip files in a Directory with their Size

list,powershell,directory,zip,size
I have came across a way to list Zip content in a Directory - I would like to include the file size information. [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') foreach($sourceFile in (Get-ChildItem -filter '*.zip')) { [IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries.FullName | %{ "$sourcefile`:$_" } } Could someone help me to add size information - current display format is: zipName:zipContentName...

uWSGI and Django segmentation fault

django,segmentation-fault,zip,uwsgi
I've been dealing with a strange error that is intermittent and hard to trace. One of the pages on my django-powered site allows users to download music they have purchased. The problem: Some users are reporting a 502 error upon downloading. A further investigation of the problem shows that there...

Is there a way to create a zip in Maven that isn't the assembly plugin?

java,maven,zip
I have a folder of files I want to zip up. It's not a java project and it's not a maven project. It's just a folder that has contents I want a zip of. The assembly plugin requires a maven project. I have searched all over but the only zip...

BitBucket API download src file zip issue

php,zip,gzip,bitbucket-api
I am connecting to the BitBucket API and would like to be able to download the zip file of a repository to the server. Due to the repositories being private it requires user access. I can download the file by the user login details within the link: https://{user}:{pass}@bitbucket.org/{owner_name}/{repository}/get/master.zip But I...

check unzip -t result

linux,shell,zip
I was wondering how I'd get the result of unzip -t file.zip so I could use it within an IF statement At the moment I've got if [ unzip -t "$file.zip" ] then #proceed with script else echo "Zip file is not ready" fi I've also tried if [! unzip...

python zip object 'disappears' after iterating through its corresponding list?

list,oop,python-3.x,zip
Total noob question here but I really want to know the answer. I have no idea why the zip object simply "disappears" after I attempt to iterate through it in its list form: eg. >>> A=[1,2,3] >>> B=['A','B','C'] >>> Z=zip(A,B) >>> list(Z) >>> [('C', 3), ('B', 2), ('A', 1)] >>>...

Loading osmdroid tiles from multiple zip files

android,google-maps,zip,osmdroid
Can I make osmdroid to load tiles from multiple zip files? I have multiple cities that I want to load tiles for them and for each one there is a zip file. My code only gets one name for zip file and obviously we can't multiple files with the same...

FIND A SPECIFIC FILE IN A FOLDER “C:\TEST” THAT CONTAINS MULTIPLE ARCHIVES “.ZIP” USING C#

c#,compression,zip,ziparchive
I have a folder "c:\test" which contains multiple archives. How do I search through all the archives in this folder for a specific file. This only search a particular archive using ZipPath: private void button1_Click(object sender, EventArgs e) { string zipPath = @"C:\Test\archive1.zip"; string filetosearch = "testfile"; using (ZipArchive archive...

Add SQLite database directly to Zip file

c#,database,sqlite,zip,ziparchive
I am trying to create an SQLite database in memory and then add it directly to a zip file I have created. So far I can create the zip file using the ZipArchive and ZipFile classes. However, I cannot find a way to add an SQLite database I have created...

Node.js: How to append files to a (archiverjs) zip from url

javascript,node.js,stream,zip
I have an object containing an array of slides. Every slide can have a media parameter containing the url to an image or video file or the link to a youtube or vimeo video. My goal is to have the slides viewer zipped and inside the zip I also must...

Apache Commons Unzip method?

java,scala,zip
I've recently discovered https://commons.apache.org/proper/commons-compress/zip.html, the Apache Commons Compress library. However, there is no direct method to simply unzip a given file to a particular directory. Is there a canonical / easy way to do this?...

Cannot extract zip file in php, no feedbackor error

php,zip,ziparchive
I am retrieving my google map in a kmz format like this: file_put_contents($_SERVER['DOCUMENT_ROOT'].'/temp/map.kmz', file_get_contents('https://mapsengine.google.com/map/kml?mid=zLucZBnh_ipg.kS906psI1W9k') ); $zip = new ZipArchive; $res = $zip->open($_SERVER['DOCUMENT_ROOT'].'/temp/map.kmz'); if ($res === true) { trace("Number of files: $res->numFiles".PHP_EOL); for( $i = 0; $i < $res->numFiles; $i++ ) { $stat = $res->statIndex( $i ); print_r( basename( $stat['name'] )...

Folder are file not zipping

java,android,zip
I have implemented Zip a folder or file then download and saving it to memory. My problem is, it is downloading without any error but i am not getting Zip file, and if i click on downloaded file it is showing: Can't show Or Can't display message. My code: String...

how to use excludesfile/includesfile in ant zip task

java,ant,zip
I need to specify a list of specific files to exclud but when I try something like excludesfile="file1, file2" I get an error executing the task saying: C:\Users.....\Desktop\testProject\project.build.xml:49: Excludesfile C:\Users......\Desktop\testProject\file1, file2 not found. Here is my code: <target name="jar" depends="common.jar"> <zip destfile="${jar.build.dir}/some-jar.jar" basedir="${base.dir}" includes="src/**,gradle/**" excludesfile="file1,file2"> </zip> </target> ...

Python tarfile and zipfile producing archives with different MD5 for 2 identical files

python,zip,md5,tar
I am trying to ensure that 2 archives with the same files inside produce the same MD5 checksum. For example, file1.txt and file2.txt have identical content, the only difference between them is creation time. However, they produce the same MD5: >>> import md5 >>> md5.md5(open("file1.zip","rb").read()).hexdigest() 'c99e47de6046f141693b9aecdbdd2dc2' >>> md5.md5(open("file2.zip","rb").read()).hexdigest() 'c99e47de6046f141693b9aecdbdd2dc2' However,...

Casting multiform part to a file

java,html,jsf,zip,multipartform-data
I have a managed bean. An HTML/JSF page sends a zipped file as a Part. I need to extract the contents from it, but to do that I need it to be File. Is it possible to cast the Part to File like as follows, and then treat it like...

C# No Data in Folder after Downloading ASP

c#,asp.net,zip
Let me start off by saying I'm sure this is something that's quite simple, unfortunately I just can't seem to figure it out. So here's my problem, I query the database, return what I need, zip it all up, and prompt user to save. When You attempt to open this,...

JavaScript: XMLHttpRequest() from Firefox addon to get zip

javascript,firefox,xmlhttprequest,firefox-addon,zip
I am trying to build a Firefox addon to request a zip file from a webpage and store it locally/decompress. I receive a 200 response code when I request the zip as a Blob type, but I am unsure how to store it since the Firefox file I/O documentation is...

Zip with tuples and list

python,string,list,zip,tuples
I need to write a code that will return the characters of two strings as a list of tuples. The code should stop when either one of the strings runs out of characters. I know is a simple code but I cannot get to work where it gives me more...

Unable to use System.IO.Compression.FileSystem.dll

powershell,zip
I am trying to get this Powershell code to work: Add-Type -Path 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.IO.Compression.FileSystem.dll' $startPath = "D:\nade\CBA\Zip\StartPath" $zipPath = "D:\nade\CBA\Zip\result.zip" $extractPath = "D:\nade\CBA\Zip\Extract" [System.IO.Compression.FileSystem.ZipFile]::CreateFromDirectory($startPath, $zipPath) [System.IO.Compression.FileSystem.ZipFile]::ExtractToDirectory($zipPath, $extractPath) However I get the following error: Unable to find type...

Maven: copy zipped resource subdirectories into target folder

java,maven,zip
I have a project with the following resources: resources - directory1 - directory2 I would like these to end up in the target folder as follows: target - resources - directory1 - directory2.zip I know how to use the maven-resources-plugin to copy the raw resources of directory1 and exclude the...

print item(s) that do not exist in both list

python,list,loops,zip
row_names=['a','b','b','b'] col_names=['a','a','a','b','b','b'] How do I only print items that do not match in both? Zip doesnt work due to unequal lengths. Something along this line? for item in row_names, col_names: if row_names[item] != col_names[item]: print item ...

Objective C - Delete files within a directory, without deleting files inside a zip

objective-c,osx,zip,nsfilemanager
how do you delete files within a directory without deleting the same files inside of a zip within that directory? So take My Documents for example: It contains log.txt, message.txt, button.txt, log.zip. Inside log.zip it contains log.txt, message.txt, button.txt. When I try to do something like this: NSArray *zipFiles =...

How do I get ZipArchive.CreateEntry name encoding right?

c#,encoding,zip
I use the following code to create a zip archive with C#. using (var zipArchive = new ZipArchive(compressedFileStream, ZipArchiveMode.Create, false)) { var zipEntry = zipArchive.CreateEntry(name + ".pdf"); ... } The name often consist of Swedish characters such as ÅÄÖ åäö. When I open the zip and look at the names...

How do I make a tarball with winrar from command line

command-line,zip,winrar
This should be straight forward like it is with 7-zip, but it's not and google is not helping. I'm doing the following at the command line rar a -ep1 "C:\Mail\test.zip" "C:\Mail\LastEmail.txt" and it keeps creating "test.zip" in rar archive format. It needs to be in zip format. Ultimately I want...

WebClient Downloading Zip Files 404 error on redirect

.net,vb.net,download,zip,webclient
I have 5 zip files i want to download from a website. http://download.companieshouse.gov.uk/BasicCompanyData-2015-02-01-part1_5.zip http://download.companieshouse.gov.uk/BasicCompanyData-2015-02-01-part2_5.zip http://download.companieshouse.gov.uk/BasicCompanyData-2015-02-01-part3_5.zip http://download.companieshouse.gov.uk/BasicCompanyData-2015-02-01-part4_5.zip http://download.companieshouse.gov.uk/BasicCompanyData-2015-02-01-part5_5.zip However if i use the following code i get a 404 error which i think is a result of the...

BadDirectoryException when zipping files

c#,zip
I tried zip all files in a folder, and save them to another folder. Error: That name specifies an existing directory. Please specify a filename. Parameter Name: fileName AppConfig: <appSettings> <add key="ZipLocation" value="c:\example\start"/> <add key="ZipSaveLocation" value="c:\example\extract"/> </appSettings> Code: //using Ionic.Zip; static void Main(string[] args) { string startPath = ConfigurationManager.AppSettings["ZipLocation"].ToString(); string...

Is it possible to read the content of a password protected zip file without extracting in C#, .NET 3.5 [closed]

c#,.net,zip
I am currently investigating the possibility of reading the content of a password protected zip file without extracting in C#, .NET 3.5, without using the third-party library such as DotNetZip... I've searched over the Google, some one said yes, some said no. I've got messed up. Thank you....

python 2.7, creating dictionary by zip from 2 lists, repeated key disappeared from the dictionary

python-2.7,dictionary,zip
I am new to programming (1st month learning python and this is my first language.) While I play around with the dictionary methods I realized that the dictionary I created with the built-in zip function seems to randomly pick a repeated key to be shown in the dictionary as the...

web2py serving zip file

zip,web2py,icalendar
I am trying to create and serve a zip file for user that contains ical files for different workers (each worker has his own ical file) The problem is that i get the right number of iCal files in my zip but the last file has all the data from...

Zip with ignore within Bash script

git,bash,zip
Found a wonderful little bash script that I've adapted to use for zip compressing managed directories, ignoring files like bower_components, .git and node_modules: #!/bin/bash # This script zips a directory, excluding specified files, types and subdirectories. # while zipping the directory it excludes hidden directories and certain file types [[...

Does CopyTo store the whole thing in memory?

c#,zip,sha1
I have the following code snippet, which is designed to add files to a .zip file, while at the same time calculating their sha1 checksum. However, it's running out of memory on large files. Which part of it is causing the whole file to be in memory? Surely this should...

Using Maven to create Javadocs as a zip file instead of a jar file

java,maven,zip,javadoc,maven-javadoc-plugin
I am trying to figure out how to create a zip file of my Javadocs instead of a jar file using Maven. I am currently creating a jar file using the maven-javadoc-plugin. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <executions> <execution> <id>attach-javadoc</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> I looked at the goals...

Upload zip files to service for user download

node.js,file-upload,express,amazon-s3,zip
I have an express (node.js) application that creates mp3 files for a user and stores them in a folder on the server. The server's file structure looks like this: data/ id#/ song1.mp3 song2.mp3 song3.mp3 id#/ song1.mp3 song2.mp3 song3.mp3 ... I want to create zip files and download links for the...

Delphi System.Zip xlsx LibreOffice

excel,delphi,zip,xlsx,libreoffice
My system is WIN7 64 and I use a Delphi XE7 component to create .xlsx files. An example result file. The files can be opened with MS Office (no problem), but with LibreOffice I can't because I have this error: "The file is corrupted and can't be openend ...". Suspicion...

Export large mount of data in a zip

ruby-on-rails,ruby,zip,export
I'm exporting some data from my server to the client. It's an zip archive but when the amount of data is to big : TimeOut ! #On my controller def export filename = 'my_archive.zip' temp_file = Tempfile.new(filename) begin Zip::OutputStream.open(temp_file) { |zos| } Zip::File.open(temp_file.path, Zip::File::CREATE) do |zip| @videos.each do |v| video_file_name...

Compress a file with password- encryption not supported

encryption,zip,solaris
I am going to compress some .csv file in one file, but I have to set password for this. I have used zip -P password file.zip myfiles but it gives me an error... zip error: Invalid command arguments (encryption not supported) I am working on Solaris machine. Could someone help...

How to create zip file with maven: Java Client + JRE

java,maven,zip,client
I want to package a java client together with a runtime into one Zip-file. How should I do this with maven? Java Client: package com.test.client; public class Client { public static void main(String[] args) { System.out.println("Hello world!"); } } This runs like: java -cp "client.jar" com.test.Client I want to deliver...

How to zip a whole directory and download using php [duplicate]

php,file,download,header,zip
This question already has an answer here: ZIP all files in directory and download .zip generated 4 answers I am self studying php and I am creating a sample test site which lets the user input the file code which will be used to determine the file path of...

PHP | Get file that is most similar to string

php,zip
Currently I have a zip folder with files in it that I do not know the filenames of. The only thing I know is that one filename is very similar to a string a have. It is literally one character off. What I am trying to do right now is...

saving base64 decoded string into a zip file

java,string,zip,base64,decode
I am trying to save a base64 decoded string into a zip file using the mentioned code: Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("/home/wemohamm/Desktop/test.zip"))); out.write(decodedString); out.close(); Here decodedString contains base64 decoded string and I can output it. I am running the code in rhel6 with Java 1.6. When I try...

Merging Jar Files (Or a ZIP with a Jar) in C++

java,c++,jar,zip,minecraft
I have a jar file and a zip file. I need to move the contents of the .zip into the .jar--how can I do this using C++? I have no pre-existing code, not really sure where to begin. Is there a system() batch command that can merge the files? Perhaps...

How to require a Ruby gem directly from its path?

ruby,gem,zip
In order to work with rubyzip i installed the gems: gem install --local rubyzip-1.1.7.gem gem install --local zip-zip-0.3.gem In my code i call the gems using the require method: require 'zip/zip' require 'zip/filesystem' I want to use require to load the gems directly from their location on my machine. i...

How to rename file forth and back in java

java,file,zip,rename,document
I want to rename a file name xxx.docx to xxx.docx.zip then rename it back to xxx.docx in Java. Here is my code. File file = new File(path); File file2 = new File(path+".zip"); file.renameTo(file2); File file3 = new File(file.getPath()); file2.renameTo(file3); It won't work. Thank you. Edit : The problem is I...

How to generate text files and download a zip file in Javascript?

javascript,download,zip,text-files
I would like to know the best way in Javascript (maybe in JQuery) to do the following things without server coding if able : Generate around 20 text files from sets of objects. Zip these files into a ZIP file. Download this ZIP file. 1. Generate around 20 text files...

Attribute Error when extracting data from a URL with a zip file

python,zip
I am trying to access the "Yield Curve Data" available on this page. It has a radio button which upon clicking "Submit" results in a zip File, from which I am looking to get the data. I am looking to get the data from the "Retrieve all data" Option. My...

Using python zipfile to find the zip password

python,zip
First let me just say I'm a pretty noob programmer, but still I'm not the kind of guy that decided he wanted to make a MMO game. My question relates to zip files.I've been researching and I couldn't find how to use the zipfile module. My idea is that you...

How to extract files from zip inmemory?

java,zip
I want to extract all files from a list inmemory, and have them in a list where each element contains one of the in the zip contained files: List<Resource> extracted = new ArrayList<>(); UrlResource url = new UrlResource("http://path.to.file.zip"); ZipInputStream stream = new ZipInputStream(url.getInputStream()); ZipEntry zipEntry; while((zipEntry = stream.getNextEntry()) != null)...

Issue with a Form Submission on Return Key

javascript,jquery,forms,zip,submit
I am fumbling for reasons for why I can't get this script to work when a "return" key is pressed. The form works when I try to submit via clicking the "GO" button yet not when the "Return" key is pressed via keyboard. I'm a bit outside my comfort zone...

How to extract a variety of zip files without knowing the extension in bash

bash,zip,tar
I'm writing a bash script which needs to handle a bunch of zip files with different possibilities (primarily tar.gz, zip, and rar). Is there a tool I can get that does this, so I could call "toolname filename", and if not, how do I determine the extension of a file...

Java: Zip file with non-static filename

java,directory,zip,zipfile
I found this ZipUtils class on this post: how to zip a folder itself using java I modified it so I could pass a zip file name. However, the only way it works is with a hardcoded static string. The zippedFile string is grabbed from the database. I have compared...

Powershell Command Line Winrar not creating file in expected location

powershell,command-line,zip,winrar
I have a Powershell script which should be zipping a specified directory at the specified location, it appears as though WinRAR does run and perform some kind of operation, however I cannot seem to locate where the zip file ends up in the file system. The idea is that I...

Python zipfile creating .pyc file not .zip archive

python,zip,archive
I can't find any info on this but when I try and create a zip archive in Python it creates a .pyc instead. #!/Python27/python import zipfile z = zipfile.ZipFile('test.zip', 'w') z.write('README.txt') z.close() This is the result of running the script. What am I doing wrong here? ...

Creating a zip archive with Unicode filenames using Go's archive/zip

go,zip
package main import ( "archive/zip" "fmt" "io" "os" "path/filepath" "strings" ) func main() { var ( Path = os.Args[1] Name = os.Args[2] ) File, _ := os.Create(Name) PS := strings.Split(Path, "\\") PathName := strings.Join(PS[:len(PS)-1], "\\") os.Chdir(PathName) Path = PS[len(PS)-1] defer File.Close() Zip := zip.NewWriter(File) defer Zip.Close() walk := func(Path string,...

Cannot log WinZip command line process

logging,command-line,vbscript,zip,winzip
I got the following vbscript test code that zip some test files via WinZip Command Line: Dim strWinZipDir, strZipFileToCreate, strFilesToZip, strWinZip, strCommand strWinZipDir = "C:\Program Files\WinZip\Winzip32.exe" strZipFileToCreate = "C:\Users\ext_dirmod_01\Desktop\TestLog.zip" strFilesToZip = """C:\Users\ext_dirmod_01\Desktop\FacturasGRA.vbs"" ""C:\Users\ext_dirmod_01\Desktop\Test Zip Windows.vbs""" Set objFSO = CreateObject("Scripting.FileSystemObject") strWinZip = objFSO.GetFile(strWinZipDir).ShortPath strCommand = strWinzip & "...

Zipping two arrays together with index in Scala?

arrays,scala,zip
I have two arrays populated with integers. They are the same size (val array1 and val array2). I want to fuse them together into tuples with their index as the third element. For example if we have val array1 = Array(5,2,6,2) and val array2 = Array(9,8,3,4) then I want to...

Error when `tar` a `.zip` on Linux

linux,osx,zip,tar
I zipped a directory on my Mac OSX with the zip command line and -r option. I scp the .zip to a cluster operating on Linux. If I try to decompress the .zip with tar -vxzf foo.zip on my machine it works. But the same command doesn't work on the...

C# Prompt for open/save zip in ASP receiving error [closed]

c#,asp.net,zip
Let me start off by saying I'm sure this is something that's quite simple, unfortunately I just can't seem to figure it out. So here's my problem, I query the database, return what I need, zip it all up, and prompt user to save. When the prompt appears, it appears...