zip

detecting binary files and character encodings in zipfiles

When reading zipfiles (using Java ZipInputStream or any other library) from an unknown source is there any way of detecting which entries are "character data" (and if so the encoding) or "binary data". And, if binary, any way of determining any more information (MIME types, etc.) EDIT does the ByteOrderMark (BOM) occur in zipentries and...

application/force-download

I'm creating a script to only upload zip files and I have the following validation allready: if($itemtype != "application/x-zip-compressed" && $itemtype != "application/zip" && $itemtype != "application/octet-stream") { throw new exception("Your file should be a zip file!"); } but I have a file with file type application/force-do...

Ruby - Working with Mechanize::File response without saving to disk

Hi all, I'm working on my first ORM project and am using Mechanize. Here's the situation: I'm downloading a zip file from my website into a Mechanize::File object. Inside the zip is a file buried three folders deep (folder_1/folder_2/file.txt). I'd like to pull file.txt out of the zip file and return that instead of the zip file itse...

ZIP Files get corrupted by IE

I am delivering a ZIP file in 64k chunks using a loop in PHP (but the problem would arise with any server side language). When fetching the file with FF, everything goes just fine. When fetching the file with IE7, some bits get corrupted. This leads to an error message regarding wrong CRC (a hash) and some of the unzipped files end up ...

Creating a zip extractor

Hello, I want to create a zip extractor for plugins that I create for asp.net sites. I want the client to be able to run the extractor and the files are placed into the correct folders that I specify. Are there any tools for this? I'm not sure how to do this, thanks ...

How to automate/simplify this content submission scenario?

I'm trying to think a strategy to automate or simplify content submission. A submission is by default done through a form and counts as one entry (some text fields + a random number of file upload fields). Through a web interface, I can imagine this as a regular form. But how can I automate the process to simplify it? I don't have a pa...

Read file comments from a zip file in Ruby

I am doing Python challenge in Ruby. I need to read the file contents and comments from a Zip file. The content is no problem with the RubyZip gem but I am unable to get the comments out. Any ideas? ...

Odd Error in SharpZipLib -- Size was x, but I expected y

I'm getting an error when I use the SharpZipLib. I have code that looks like FastZip compressor = new FastZip(); compressor.CreateZip(outputFileName, currentWorkingDirectory, true, ""); Which seems to be correct. However, I get a ZipException claiming that size was 0, but I expected 54 I have no idea what that means. Anyone have...

Django Zip upload permission problem

I have few uploads in this app, uploading csv files is working fine. I have a model that has zip upload in it. Zip file is uploaded, can be viewed, but having issues extracting it. class Message(models.Model): uploadFile = models.FileField(_('images file (.zip)'), upload_to='message/', ...

Zipping Things Using Objective-C

Hello, I'm learning Objective-C using GNUstep(because I use Linux). I was thinking in create a simple zipper application only to practice, but how where i can find a tutorial to build it? and which is the common library used to this things in Objective-C? Thanks. ...

any functions to create zip file of directory/file on vista with delphi 2009

I am looking for a simple method of zipping and compressing with delphi. I have already looked at the components at torry delphi:http://www.torry.net/pages.php?s=99. They all seem as though they would accomplish what I want however a few disadvantages to using them is that none of them run in delphi 2009 and are very complex which makes ...

Blackberry - Programmatically extract/open zip file

I have looked online with mixed results, but is there a way to programmatically extract a zip file on the BB? Very basic my app will display different encrypted file types, and those files are delivered in a zip file. My idea was to have the user browse to the file on their SDCard, select it, and I extract what i need as a stream from th...

How to validate that a file is a password protected ZIP file, using C#

Given a path to a file, how can I validate that the file is a password-protected zip file? i.e., how would I implement this function? bool IsPasswordProtectedZipFile(string pathToFile) I don't need to unzip the file -- I just need to verify that it's a ZIP and has been protected with some password. Thanks ...

Apache Config Mime Types: xlsx files are being interpreted as zip files on download, why?

Background: For some reason, whenever a user tries to open an xslx (excel 2007) file from our intranet using MSIE, the file download dialog interprets it as a "zip" file. Admittedly, xslx files really are zip files, but we don't want that behavior. Just open in Excel, please. Question: Firefox, OTOH, opens the files normally. Is it ...

Implementation of ZipCrypto / Zip 2.0 encryption in java

I'm trying o implement the zipcrypto / zip 2.0 encryption algoritm to deal with encrypted zip files as discussed in http://www.pkware.com/documents/casestudies/APPNOTE.TXT I believe I've followed the specs but just can't seem to get it working. I'm fairly sure the issue has to do with my interpretation of the crc algorithm. The docum...

How to detect whether a Windows batch file is run from a ZIP archive

One of the ways our app is distributed (on Windows) is as a ZIP archive. Inside this archive is a batch file used for starting the app. The user is supposed to unzip the archive before running our app, but frequently users ignore our instructions and try to run the app without unzipping the archive first. When users do this, the app fail...

Can I zip more than two lists together in Scala?

Given the following Scala List: val l = List(List("a1", "b1", "c1"), List("a2", "b2", "c2"), List("a3", "b3", "c3")) How can I get: List(("a1", "a2", "a3"), ("b1", "b2", "b3"), ("c1", "c2", "c3")) Since zip can only be used to combine two Lists, I think you would need to iterate/reduce the main List somehow. Not surprisingly, the f...

.Net Zip Up files

Whats the best way to zip up files using C#? Ideally I want to be able to seperate files into a single archive. ...

zip64 support in php?

I have a file downloaded by a cron that is in zip64 format. How can I unzip it using php or via a php cmd()? ...

ZIP file created with SharpZipLib cannot be opened on Mac OS X

Argh, today is the day of stupid problems and me being an idiot. I have an application which creates a zip file containing some JPEGs from a certain directory. I use this code in order to: read all files from the directory append each of them to a ZIP file using (var outStream = new FileStream("Out2.zip", FileMode.Create)) { ...