6

Our problem

We are building a browser based application that allows a user to upload files to a server for processing. The server side is written in PHP using the Codeigniter v2.0.2 framework. The files to be uploaded are the output of another system and their format is out of our control. They can be very large (100's of MB) but much of their content is not needed for the server side processing. The files themselves are actually zip format (albeit with a bespoke extension) and containing a lot of image files together with a relatively small XML file and it is only this we need for the server side processing. Obviously it would be pretty wasteful to send the entire file when we need less than 1% of it's mass. We also don't want to ask users to manually extract the XML from the file.

My question

What are our options for writing client side code that can extract the XML file from the zip and send it? Happy to consider any technologies that run in most modern browsers. Whilst we are a C#/C++ coding house, web technologies are not our day-to-day so code examples gratefully received!

Many thanks.

Toenex
  • 223
  • 1
  • 10
  • Have a look at this answer http://stackoverflow.com/questions/2163857/unzipping-zip-archives-with-javascript-in-firefox-3-6 There are some options, but none of them will work with older browsers (I'm talking IE8 kind of old) – cypher Jun 24 '11 at 09:24
  • Another question with a promising answer at http://stackoverflow.com/questions/2095697/unzip-files-using-javascript – Fuseblown Jun 24 '11 at 10:04

3 Answers3

1

Are you looking for a library for zip compression? You can use SLSharpZipLib on the client side and its .NET counterpart on the server side.

Michael Eakins
  • 4,149
  • 3
  • 35
  • 54
1

This Should be easily doable with a signed java applet, 90% users will have java installed,if not client can install it.

Signed Java applet will be able to access the file and extract the file you need and transfer it to your server.

This will also be quite fast so even large files will work just fine.

0

I used this lib by Phil Sturgeon. My files were under 20mb so I can't tell how it will work with your project.

bassneck
  • 4,053
  • 4
  • 24
  • 32
  • Thanks, but this is a server side library that requires the data to have already been uploaded to the site. I'm after something that will only upload one of the files in the zip archive. – Toenex Jun 26 '11 at 09:22