Skip to main content
Known Participant
February 26, 2007
Question

How to check file size on upload? In case file is massive...

  • February 26, 2007
  • 12 replies
  • 1624 views
Hi, I have an upload file button on my page, is there a way to check a file size before allowing user to upload file. Right now, if a user uploads a huge file (5 gigs), it would crash is there a file to somehow stop them? I've researched forums and all say that you have to first upload the file and then check the file size with cffile, but is there another way?

Thanks so much,
c
This topic has been closed for replies.

12 replies

February 26, 2007
When this is an issue for me, I use SmartASPUpload. Unfortunately, the vendor has discontinued it.
Inspiring
February 26, 2007
you can try using cgi.content_length which will report total size of
content being processed by the page (file size + page size + other
stuff) in bytes... but i can't remember if it has to upload the file to
the cf temp dir first or not...


--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com
February 26, 2007
CGI.CONTENT_LENGTH is used after the file is uploaded.