473,498 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Upload file Check file size

Using <INPUT type"file" runat="server"> to upload a file. When the
file size is too large I get a "page cannot be display" error. Thats
cool I'm down with that. But is there a way to check for file size
(client or server side), so that error doesn't occur?

Thanks
--Dietrich
Nov 18 '05 #1
4 2584
Not that i am aware.
The file size upload is a server restriction and you can change it.
Also i think that error is one of the standard error pages from IIS server.
So you can modify it.

George.

"lawrence" <dw******@uiuc.edu> wrote in message
news:e7**************************@posting.google.c om...
Using <INPUT type"file" runat="server"> to upload a file. When the
file size is too large I get a "page cannot be display" error. Thats
cool I'm down with that. But is there a way to check for file size
(client or server side), so that error doesn't occur?

Thanks
--Dietrich

Nov 18 '05 #2
On Thu, 10 Jun 2004 13:39:31 -0400, George Ter-Saakov <no****@hotmail.com>
wrote:
Not that i am aware.
The file size upload is a server restriction and you can change it.
Also i think that error is one of the standard error pages from IIS
server.
So you can modify it.

George.

"lawrence" <dw******@uiuc.edu> wrote in message
news:e7**************************@posting.google.c om...
Using <INPUT type"file" runat="server"> to upload a file. When the
file size is too large I get a "page cannot be display" error. Thats
cool I'm down with that. But is there a way to check for file size
(client or server side), so that error doesn't occur?

Thanks
--Dietrich



Yes, you can change it to a larger number:

http://www.tek-tips.com/gfaqs.cfm/pid/855/fid/3217

please excuse the annoying flyover ad on that page :)

I also agree, I don't know of any JS that can detect that, unless it had
extremely lax browser privileges, which is a very rare setup you'd have to
make sure is there (change client's browser settings). I don't know if
you can somehow create an HttpModule to intercept the incoming file before
the server check is done by ASP.NET (note this is not IIS throwing the
error, but ASP.NET as it's an ASP.NET setting).

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #3
ASP.NET throws the error? What is actually happening. Is some sort of
header with file size info being read, or is the file being streamed,
and then chokes at the set limit?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
On Thu, 10 Jun 2004 12:16:34 -0700, dietrich <an*******@devdex.com> wrote:
ASP.NET throws the error? What is actually happening. Is some sort of
header with file size info being read, or is the file being streamed,
and then chokes at the set limit?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


Well, if you follow that link, you'll notice that it's a setting you can
put in web.config, which is ASP.NET specific. It was introduced to
prevent malicious uploading or be able to conserve your bandwidth (enforce
file sizes).

It is possible IIS has a limit of its own, and maybe something you can set
also, which would be checked first. I can't remember tho, when you see
this error page, if it's a result of IIS giving the error, or ASP.NET
playing dumb and returning a 500....

I'm not familiar with all the internals of exactly what goes on in this
scenario. The times I've hit it, it hit the ASP.NET limit and errored
out, so I was able to up the size and get it to go through.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #5

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

Similar topics

11
6384
by: Thomas Mlynarczyk | last post by:
Hello, I want to upload files via an HTML form and store them somewhere on my webspace. So far so good. I am just a bit concerned about security issues and traffic. My provider has set a file...
3
11735
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...
5
5430
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
10
2850
by: matt | last post by:
I have this code, works perfectly on Windows server, but now i'm trying to run it on a Linux server, the form submits, i get no errors, but the photo doesnt upload, and the caption file doesnt...
4
4448
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use...
9
20874
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
9761
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
2137
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...
3
4400
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
1
4853
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
0
7125
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
7167
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
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6890
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...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.