
September 9th, 2011, 04:26 AM
|
|
Registered User
|
|
Join Date: Feb 2007
Posts: 28
Time spent in forums: 16 h 12 m 5 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by kiteless You can check CGI.CONTENT_LENGTH on the server before starting the upload with CFFILE. Not perfect but should give you a good idea of the size of what they are trying to upload.
CF 9 added some additional features to handle file uploads, and I believe it now writes the file directly to disk rather than storing it in memory first.
However, uploading large files is really not something you want a web application to handle (whether it is PHP, CF, Java, etc.). The entire time the file is uploading, it is using a processor thread. So depending on how many people are doing this and how big the files are, you can easily use up your entire thread pool.
There are much more efficient ways to do this, such as: http://commons.apache.org/fileupload/
Hope that helps,
Brian |
Thanks Brian
The problem with CF7 is that the moment you hit 'submit' the entire file is written to memory (ie. uploaded) before you even use CFFile. CFFile is the 'quick bit' copying it from server memory to a file location. It's not until the file has been uploaded to memory that you can use CGI.CONTENT_LENGTH - and if the file was above the post limit of the CF Server - then you won't even get that far! (outofmemory)
I would love my client to upgrade to CF9 Enterprise - but it's not a quick process
Thankfully not many people are likely to be doing this simultaneously - I suspect only 1 person at a time will ever be uploading.
I'll have a look at the fileupload - but unless I find some simpler integration details it might fall outside of my timeframe 
|