Solved

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

Posted on 2010-08-27
2
745 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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