Solved

Cannot upload more than 2 MB of data -- ASP.NET Web Services

Posted on 2010-08-27
2
741 Views
Last Modified: 2012-05-10
Hi,
  I have a web service which uploads files to the server..
 when i try to upload more than 2mb of data.. it errors out..

this is my configuration in the web.config
      <httpRuntime maxRequestLength="2097151" executionTimeout="1800" />

if i change to
   <httpRuntime maxRequestLength="10000000" executionTimeout="1800" /> it gives error

Error: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlReader.MoveToContent() at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XElement.Parse(String text, LoadOptions options) at BPELServices.BPELServices.IBService(String ibXML)


Please Help

0
Comment
Question by:gautam_reddyc
2 Comments
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 500 total points
Comment Utility
Hi,

Uploading such a huge data that is 2048 MB in the first case and in second case trying to upload data 9766 MB is too much large. So the primary reason of exception is that you are crossing the limit of Asp.Net engine to upload the data back to the server.

I read a paragraph: (Refernce: http://msdn.microsoft.com/en-us/library/aa479405.aspx)
The value given the executionTimeout attribute is the number of seconds the upload is allowed to occur before being shut down by ASP.NET. If you are going to allow large files to be uploaded to the server, you are also going to want to increase this value along with the maxRequestLength value

They say that sometimes exception is there because of mismatching of size limits of file in Asp.Net and the file uploaded by the user (http://aspnetresources.com/articles/dark_side_of_file_uploads).


I would personally suggest you to keep your file size upto some 100MBs only. And here is the article that bets for uploading file on any size (http://www.15seconds.com/issue/071025.htm)


Regards,
VSS
0
 

Author Closing Comment

by:gautam_reddyc
Comment Utility
done..thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now