G
Guest
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.
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.