473,387 Members | 3,684 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,387 software developers and data experts.

Odd File Upload Experience

I am using the html input type=file to upload files to the webserver. This is working fine, but only for files less than ~3mb in size. When I attempt to upload a file >3mb, i immediatley receive a standard error "page cannot be displayed, cannot find server or dns error". Very odd indeed. In looking through the logs, I see my request and it appears to be logging a HTTP 400 (Bad Request). I believe this to be a problem related to asp.net or the size of the post (viewstate, etc) - just an assumption. In trying this from Mozilla Firefox browser, it does give me an immediate popup error "document cotains no data". Recall, this code does work, but only for smaller files.

If someone could try this out to see if they can send files >3mb to their webserver, please let me know.

Following is the webform code:
<form id="ccgImport" method="post" encType="multipart/form-data" runat="server">
<input id="File1" title="Select File To Upload!" maxlength="9999999" type="file" size="27" name="File1" runat="server">
<asp:button id="cmdUpload" runat="server" Height="25px" Width="90px" Text="Upload"></asp:button>
<asp:label id="lblMessage" runat="server" Height="25px" Width="300px" Font-Bold="True" ForeColor="Red"></asp:label>
</form>

Following is the code behind (placed in the cmdUpload's OnClick Event):
File1.PostedFile.SaveAs(c:\foldername\file.txt])
Perhaps I have to use a more robust upload method, but not sure why this worlks for files <3mb than errors so oddly for larger files. This one has me stumped!!

Thanks in advance!
Nov 18 '05 #1
1 1418
http://support.microsoft.com/default.aspx?scid=kb;[LN];295626

Add to your web.config:

<system.web>
<!-- maxsize for uploaded file 100MB KB #295626 -->
<httpRuntime maxRequestLength="102400"/>

</system.web>

HTH,
Greg

"Chris Fink" <Ch*******@discussions.microsoft.com> wrote in message
news:A5**********************************@microsof t.com...
I am using the html input type=file to upload files to the webserver. This is working fine, but only for files less than ~3mb in size. When I
attempt to upload a file >3mb, i immediatley receive a standard error "page
cannot be displayed, cannot find server or dns error". Very odd indeed. In
looking through the logs, I see my request and it appears to be logging a
HTTP 400 (Bad Request). I believe this to be a problem related to asp.net
or the size of the post (viewstate, etc) - just an assumption. In trying
this from Mozilla Firefox browser, it does give me an immediate popup error
"document cotains no data". Recall, this code does work, but only for
smaller files.
If someone could try this out to see if they can send files >3mb to their webserver, please let me know.
Following is the webform code:
<form id="ccgImport" method="post" encType="multipart/form-data" runat="server"> <input id="File1" title="Select File To Upload!" maxlength="9999999" type="file" size="27" name="File1" runat="server"> <asp:button id="cmdUpload" runat="server" Height="25px" Width="90px" Text="Upload"></asp:button> <asp:label id="lblMessage" runat="server" Height="25px" Width="300px" Font-Bold="True" ForeColor="Red"></asp:label> </form>

Following is the code behind (placed in the cmdUpload's OnClick Event):
File1.PostedFile.SaveAs(c:\foldername\file.txt])
Perhaps I have to use a more robust upload method, but not sure why this worlks for files <3mb than errors so oddly for larger files. This one has
me stumped!!
Thanks in advance!

Nov 18 '05 #2

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

Similar topics

7
by: OneSolution | last post by:
Hi All, Here's one thing that I don't know much about - file uploading. As part of my project, I will have to build a file manager of sorts - perhaps a document manager. Anyhow, this involves...
1
by: Chris Mosser | last post by:
I'm looking for an applet that allows for multiple file uploads. I found jupload and am considering using that, but I might have a couple issues. I need to build a web app for a print shop, that...
1
by: Ron Vecchi | last post by:
When posting a file upload I have taken in consideration the maxRequestLength and set it accordingly. In my case where a posibility of a 30 meg file can be uploaded I set it to 30720. Although...
7
by: Nathan Sokalski | last post by:
I have a form that allows the user to upload a file. Even though <input type="file" runat="server"> is intended to have the user choose the file using the browse button, it still allows them to...
3
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on our 100Mb/s LAN. Simply copying the file, I get...
2
by: asiva | last post by:
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...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.