> How can I detect the size of the file prior to upload to prevent someone
> from maliciously uploading a 100MB file (or worse!). I know I can see it
> with #file.filesize# but this is only after the upload, right?

I'm afraid you really can't do this with any server side programming (such
as CF).  You see, when you attach files to a form through the FILE input
type the file is basically added to the form as a big blob of binary data.
Thus, the file data itself isn't available to the server until AFTER the
upload completes.

You can check the filesize AFTER the upload and then delete the file if its
too big, but this doesn't avoid wasted bandwidth and CPU cycles dealing with
overly large files.

I've never tried it, but you might be able to use JavaScript to do some sort
of test on the file data before the upload completes.  This has peaked my
interest, so I'm going to look into it... I'll post a follow up if I find
anything useful.

Regards,
Seth Petry-Johnson
Argo Enterprise and Associates

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to