Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Upload File Size

Reply
Thread Tools

Upload File Size

 
 
=?Utf-8?B?YXNpdmE=?=
Guest
Posts: n/a
 
      10-18-2006

I am using <INPUT id="File1" type="file" name="File1" runat="server"> to
upload file to the server.

My Questions:
1. Is it possible to check the file size before the file is uploaded other
than using
Scripting.FileSystemObject ?

2. If answer to 1 is no, is it possible to check in the server side the
Request.ContentLength and prevent the exception/ blank page if the file size
exceeds the value in <httpRuntime maxRequestLength="4000" />. Ie Stop the
http request and show the previous page. I do not want to refresh the page as
there may be some data in the submitted page which should not be cleared.

3. If answer to 2 is no. I can set a very large value in <httpRuntime
maxRequestLength="400000000" />. If the contentlength is large is there a way
in the server side to stop the upload and show the user submitted page with
an error message.

--
Thanks
asiva
 
Reply With Quote
 
 
 
 
Siva M
Guest
Posts: n/a
 
      10-18-2006
1. File size cannot be checked on the client-side as there is no way to
access the local file system from a web page

2 & 3: Information about the file uploaded in only available after the
complete file content has been uploaded and hence upload cannot be stopped
in the middle.

"asiva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

I am using <INPUT id="File1" type="file" name="File1" runat="server"> to
upload file to the server.

My Questions:
1. Is it possible to check the file size before the file is uploaded other
than using
Scripting.FileSystemObject ?

2. If answer to 1 is no, is it possible to check in the server side the
Request.ContentLength and prevent the exception/ blank page if the file size
exceeds the value in <httpRuntime maxRequestLength="4000" />. Ie Stop the
http request and show the previous page. I do not want to refresh the page
as
there may be some data in the submitted page which should not be cleared.

3. If answer to 2 is no. I can set a very large value in <httpRuntime
maxRequestLength="400000000" />. If the contentlength is large is there a
way
in the server side to stop the upload and show the user submitted page with
an error message.

--
Thanks
asiva

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      10-19-2006
Due to security restrictions the only way to provide a rich upload
experience like you describe is for the user to install a rich client of
some kind that can access the file system, such as an ActiveX control or a
windows forms app or control of some kind that has the necessary
permissions.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net


"asiva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I am using <INPUT id="File1" type="file" name="File1" runat="server"> to
> upload file to the server.
>
> My Questions:
> 1. Is it possible to check the file size before the file is uploaded other
> than using
> Scripting.FileSystemObject ?
>
> 2. If answer to 1 is no, is it possible to check in the server side the
> Request.ContentLength and prevent the exception/ blank page if the file
> size
> exceeds the value in <httpRuntime maxRequestLength="4000" />. Ie Stop
> the
> http request and show the previous page. I do not want to refresh the page
> as
> there may be some data in the submitted page which should not be cleared.
>
> 3. If answer to 2 is no. I can set a very large value in <httpRuntime
> maxRequestLength="400000000" />. If the contentlength is large is there a
> way
> in the server side to stop the upload and show the user submitted page
> with
> an error message.
>
> --
> Thanks
> asiva



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
CGI file upload - problems with file size... DJ Stunks Perl Misc 1 01-23-2006 05:35 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
File Upload and File Size Limitations Robert Strickland ASP .Net 6 11-01-2004 06:13 AM
Upload file Check file size lawrence ASP .Net 4 06-10-2004 08:02 PM



Advertisments