[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2010-08-27
2
Medium Priority
?
758 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 1500 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 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