I'm working on a file uploader and I'm scripting the ability to upload zip files. I'm only parsing files (images, to be percise), all other data including directories are discarded as I'm not going to parse beyond the root of the .zip file.
Question 1) Does the entire .zip file have to be uploaded to the server prior to reading it? Or can I slurp it into memory? Now that I think about it, this sounds like a bad idea but leads to the next question
Question 2) Servers all have timeouts for scripts that run forever and I fear that if someone uploads 100s of MB worth of files in their zip file, my server will cut off. This is where it might be a little OT..
I've seen some forums (though I can't remember which) that have admin panels that send out emails. It sends out a bunch, then it redirects to a page with a timeout button/timer on it, then it reloads itself and starts again with another chunk of emails to send out, reloads with a new timeout button/timer, etc. And when I have over 10,000 emails to send it reloads the page about 10 times or so I think.
How is that done? I'd like to use that same idea if the user is uploading a huge zip file.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.