NYCPHP Meetup

NYPHP.org

[nycphp-talk] File upload choices

David Krings ramons at gmx.net
Fri May 18 10:17:17 EDT 2007


Ben Sgro (ProjectSkyline) wrote:
> Hello All,
>  
> I'm working on a client spec now and I need to find the best way to allow
> a user to upload multiple files at the same time.
>  
> What solutions are people happy with? I'm open to using any method to get
> this done {flash, js, whatever..}. I'd really like it to take place 
> without refreshing
> the entire page. I'm using JS functions with *ajax* to keep the wizard-like
> part of the application very clean and fun to use.
>  
> Thanks!
>  
I just came across this and went the ZIP file route. User creates a ZIP 
archive with any number of files or folders and then uploads that 
archive. I was impressed how easy it was to unzip and get the archive 
contents (after I was told that I have more than a hammer and that not 
everything is a nail). I also like the performance, although I haven't 
crash tested it yet with a huge archive.
The disadvantages are somewhat obvious, the user needs to perform an 
extra step, the upload time can be quite lengthy (script time out, 
although that is easy to address), and the file size can be big (several 
MB, but that is also somewhat easy to address). It also requires a user 
that is capable of using a ZIP tool and locating the resulting file.
The advantage is clearly that it doesn't require any JS, AJAX, Flash or 
whatever else, but works with a plain simple HTML browse box. Also, 
since the archive has a directory you know exactly which files and 
folders you get and where they are located after unpacking. That saved 
me from getting complicated and parsing through a bunch of unknown 
territory. You can also check the contents first and decide if there is 
anything in the archive that is useful for the purpose without handling 
the individual file. Hmmm, I should add this to my project.... In any 
case, this solution doesn't require fancy tools, the code needed is a 
few dozen lines, and all components involved are for free and exist on 
many systems. For what I want and can do this is the best solution.

David



More information about the talk mailing list