Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload File Size Validation

Status
Not open for further replies.

ToddWW

Programmer
Mar 25, 2001
1,073
US
Well, I posted this back in March and didn't have much success. So I thought I would post it again to see if anyone has any ideas.

I have a file uploader on my site which has been working fine for quite some time now. I want to validate the file size before performing the full upload and I don't think I want to use any ActiveX or signed scripts to gain access to the visitors file system, although six months later, I'm open for new suggestions. I have tested the Request.BinaryRead and Request.TotalBytes properties which work fine and can be good tools to validate file size, however they are both expensive operations. I think the entire form contents need to be sent to the server before you can get the value of either of these properties, so a file upload of 5MB would take a few minutes for either of those properties to return a value.

Any ideas on how to validate file size inexpensively before executing the file upload. I've looked at all the sites, xdrive.com, etc.. and can't find a solution.

TW
 
Hi Todd,

I am really only just dipping my toes in when it comes to asp at the moment so i dont know if i'm off track here at all but i worked on a project with a similar requirement recently. The asp used in that project utilised the mySmartUpload object. it then tested against mySmartUpload.MaxFileSize however this could be just another method of checking file size after the upload. It looks that way to me but i thought i'd mention it anyway as im not sure and as i said im a newbie with asp. Hope it helps, sorry if i wasted your time.

Rob
 
U could do this by an client side script witch checks the file size before submit. ________
George, M
 
shaddow,

Do you have a client side script example that would give me access to the visitor's file system to check the file size ??

TW
 
As i sayed u need to use ActiveX on the client side... ________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top