Solved

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

Posted on 2010-08-27
2
749 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 500 total points
ID: 33548581
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
ID: 33570127
done..thanks
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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