Another File Upload question
- From: "ricardo corbacho perez" <ricardo corbacho perez@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Jul 2005 04:22:02 -0700
Hi there,
I've been reading all I could find on the control 'input type=file' and all
the trouble that it comes when uploading large binary files (>4MB) to a DB
server or server path.
I've seen plenty of examples about it, and they all agree that to make
possible the upload of those files, it's mandatory to change the web.config
(or machine.config) for the maxRequestLength attribute of the <httpRuntime>
element.
What I'd need though, is a way for NOT allowing content larger than those
4MB to be uploaded. I've tryed the following on my code, but it's not
working (probably because I've also read that when submitting the webform,
the content is already sent to the server, thus if you send 50MB you'll have
to wait until the server returns an error)
if( FileInputAttachment.PostedFile.ContentLength ) > 1024
{
//change a label text to display an error
}
Is there a way of querying for the PostedFile.ContentLength BEFORE posting
the data to the server? This way I could warn the users not to upload files
larger than a MB or so...
Thanks!!
.
- Follow-Ups:
- Re: Another File Upload question
- From: Joerg Jooss
- Re: Another File Upload question
- From: Kevin Spencer
- Re: Another File Upload question
- Prev by Date: Re: There has to be a better way to develop web applications.
- Next by Date: DataGrid and JavaScript
- Previous by thread: How to make a require textbox
- Next by thread: Re: Another File Upload question
- Index(es):
Relevant Pages
|