in reply to CGI file upload: Print to filehandle vs move file
Yes, renaming a file is much faster and quite appropriate for things like image files.
You have a potential denial of service attack when you slurp the entire uploaded file into RAM, which is why CGI recommends using read instead.binmode UPLOADFILE; while ( <$upload_filehandle> )
while ($bytesread = $io_handle->read($buffer,1024)) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI file upload: Print to filehandle vs move file
by tospo (Hermit) on Oct 19, 2009 at 11:34 UTC | |
by rowdog (Curate) on Oct 20, 2009 at 02:52 UTC |