zip

How can i zip files in Java and not include files paths

For example, I want to zip a file stored in /Users/me/Desktop/image.jpg I made this method: public static Boolean generateZipFile(ArrayList<String> sourcesFilenames, String destinationDir, String zipFilename){ // Create a buffer for reading the files byte[] buf = new byte[1024]; try { // VER SI HAY QUE CREAR EL ROOT PATH ...

Zip multiple database PDF blob files

I have a database table that contains numerous PDF blob files. I am attempting to combine all of the files into a single ZIP file that I can download and then print. Please help! <?php include '../config.php'; include '../connect.php'; $session = $_GET['session']; $query = "SELECT $tbl_uploads.username, $tbl_uploads...

Using ZLib unit to compress files vs using ZipForge

There are many questions on zipping in Delphi, anyway this is not a duplicate. I am using ZipForge for zip/unzip capability in my application. Currently I use 2 features of ZipForge: 1) zip and unzip (!) 2) password protect the archives Now I am removing the password from all the archives so I need only to zip and unzip files. I zip...

How can I add entries to an existing zip file in Java?

Opening the file with a ZipOutputStream overwrites it. Is there a way to keep the file and just add new entries? ...

Processing Zip files in Ruby

Is anybody aware of a open source Ruby library that allows the user to process zip file entries in memory? i.e. without writing them to disk ...

Using R to download zipped data file, extract, and import data

@EZGraphs on Twitter writes: "Lots of online csvs are zipped. Is there a way to download, unzip the archive, and load the data to a data.frame using R? #Rstats" I was also trying to do this today, but ended up just downloading the zip file manually. I tried something like: fileName <- "http://www.newcl.org/data/zipfiles/a1.zip" con1 <...

Syntax for the zip.save(); method in C#

Hi, I have been using the Ionic.zip namespace for the zipping program. But I have seen that you should provide the name of the .zip file in C# program everytime and if the user has to zip many files he cannot go the sourcecode and change the program line everytime so I copied the sourcepath to a variable & then sourcepath/destddir should...

bash script code help to make zip/tar of several folders .

I am very new in bash and never coded in before but this task is stuck so need to get rid of it . I need to make bash script to make a single compressed file with several dirs. Like - /home/code/bots/ /var/config/ . . . /var/system/ and all will be compressed to single file /var/file/bkup.[zip][tar.gz] Thanks in advance ...

i can use this 'zipme' to download source code from gae , but can not i download another file around me..

i follow this article : zipme and i download my file successful , and i want to download another file that ex: the parent file so i change this: dirname=os.path.dirname folder = dirname(__file__) to dirname=os.path.dirname folder = dirname(dirname(__file__)) but the error is : firefox can't find the file why ? thanks ...

Symfony Batch Action

Hi there! I'm trying to create a batch action (symfony admin) that enables the creation/download on the fly of zip file containing users photos which are avaialable on the uploads/images directory. Here is the code that I already implemented: public function executeBatchDownloadFotos(sfWebRequest $request) { $zip = new Zip...

How to quickly zip large files in PHP

Hi, I wrote a PHP script to dynamically pack files selected by the client into zip file and force a download. It works well except that when the number of files is huge (like over 50000), it takes a very long time for the download dialog box to appear on the client side. I thought about improving this using cache (these files are not c...

Zip Stream in PHP

Hi, I have a PHP script that creates a zip file on the fly and forces the browser to download the zip file. The question is: could I directly write the zip file to an output stream which is connected to the user's browser rather than save it as a real file on the server first and then send the file? Thanks in advance. ...

id like to add 7-zip functionality to my C# application, how would i do this?

i currently have this code to extract a passworded 7zip SFX to the appdata location run it then clean up after its self, but i'm losing a lot of compression i think also would just like to learn how to do this, so id like to learn how to make it so my application can extract a .7z file without having 7-zip installed on the computer (the ...

How to get ZipArchive to not overwrite certain files and folders

Hello all, I would like to extract a zip folder to a location and to replace all files and folders except a few, how can I do this? I currently do the following. $backup = realpath('./backup/backup.zip'); $zip = new ZipArchive(); if ($zip->open("$backup", ZIPARCHIVE::OVERWRITE) !== TRUE) { die ('Could not open archive'); } $z...

What is the Python equivalent of java.util.zip.Inflater?

I have a Java program that opens a socket connection to a server that streams Zip compressed data. I read(bytebuffer) from the stream, setInput(bytebuffer) on the zip object, and inflate(outputbuffer) to get my uncompressed data. What would be the equivalent in python? Here is the java code: byte[] compressedBytes = new byte[1024]; in...

When creating a zip archive, what constitutes a duplicate entry

In a Java web application I am creating a zip file from various in-memory files (stored as byte[]). Here's the key bit of code: ByteArrayOutputStream baos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(baos); for (//each member of a collection of objects) { PDFDocument pdfDocument = //gene...

in C# .net framework 2.0 how can i unzip a .zip file to a specified directory and have it wait untill it is done before moveing on

Hello! i have a .zip file that my application needs to extract, and run how would i go about doing this? it needs to extract Programs\Test\Build.zip to the directory: string tempFolder = System.Environment.GetEvironmentVariable("HomeDrive"); then it needs to wait till its finished, then run the exe "Compile.exe" that was extracted, id...

gunzip a file stream in R?

I'm trying to create an R API for StackOverflow. The output is gzipped. For example: readLines("http://api.stackoverflow.com/0.9/stats/", warn=F) [1] "\037‹\b" ...

How can I return gzipped css/js

I'm using .NET and the simple question is: How or can I let the web browser know that <script type="text/javascript" src="/Scripts/myjsfile.js"/> is gzipped? can I just append .gz to the source? This article, which is pretty cool, shows how to to compress my dynamic html by plugging into the Response.Filter stream object to return...

Adding a file to a zip uncompressed with PHP

I'm looking at a tutorial for creating an ePub file. It states that the zip that contains the ePub book must contain a textfile called mimetype that "must be first in the zip file, uncompressed". The example he gives uses a commandline tool, I was wondering how I could do the same thing in PHP. I assume it would be first in the zip fil...