473,388 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Upload File Size


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
Oct 18 '06 #1
2 1808
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" <ar*******@apriso.comwrote in message
news:41**********************************@microsof t.com...

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

Oct 18 '06 #2
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" <ar*******@apriso.comwrote in message
news:41**********************************@microsof t.com...
>
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

Oct 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
0
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle...
1
by: Marko Vuksanovic | last post by:
I used the following code for implementing a file upload progress indicator, using UpdateProgress Panel, though I have a problem that FileUpload.Has File always returns false. Any suggestions what...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
2
by: Event Horizon | last post by:
Hi, I'm trying to add an simple upload applet to shopping cart script. My new applet form sends all needed post fields ( quantity, product, etc... ) but the "file" post field is hardcoded in...
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.