[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 645
  • Last Modified:

FileUpload Control

I need to upload large files (150 mb) in using the ASP fileupload control.  The site runs on the 2.0 framework.  I increased the defualt size from 4mb but I keep getting an out of memory exception error.
0
triplebd69
Asked:
triplebd69
  • 7
  • 6
1 Solution
 
GeorgeGerguesCommented:
Can you check the memory limit on the application pool settings.

there might be a hard limit.

also check the application log for event .


Best of Luck.
0
 
triplebd69Author Commented:
Here the therror I get back I think it is in the webservice but not sure.  If so any ideas how to get past this?
System.Web.Services.Protocols.SoapException: There was an exception running the extensions specified in the config file. ---> Maximum request length exceeded.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at MEI.SPMEIUniversal_DocUpload.SPDocLibUpload2.UploadToDocumentLibrary(String spSiteUrl, String documentLibraryGuid, String fileName, XmlNode fieldNode, Byte[] fileBytes) in C:\mei\Class Library\MEI_SP_Documents\MEI_SP_Documents\MEI_SP_Documents\Web References\SPMEIUniversal_DocUpload\Reference.vb:line 122
   at MEI.SPDocuments.SP_Documents.Upload(IDocument doc) in C:\mei\Class Library\MEI_SP_Documents\MEI_SP_Documents\MEI_SP_Documents\SP_Documents.vb:line 372

Open in new window

0
 
GeorgeGerguesCommented:
That is very obvious the max request size , which in your case should be 120 + megs ( in bytes)

but honestly that is very large for a post to a web service .

I think you might have some design changes to make.



If you want to share your config file snippets , please inidicate which config file you are referring to.

Best of luck.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
triplebd69Author Commented:
Hers is the setting for the file size in my web.config.  I need to handle a file that is 150mb.
<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="153600000"></requestLimits>
      </requestFiltering>
    </security>
	</system.webServer>

Open in new window

0
 
GeorgeGerguesCommented:
You need twice as much  of the file size .
307200000


<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="307200000"></requestLimits>
      </requestFiltering>
    </security>
        </system.webServer>


Give it a shot
0
 
triplebd69Author Commented:
I don' understand, could you please explain why I need to double the size?
0
 
GeorgeGerguesCommented:
because it is sent as a xml serialized file( no matter what is your file )

for example

myfile.txt

content
"Hello World"

<xml File > 
  <Name  = xyz.txt > </Name>
  <Content MIME 8 bit or other .. = d6f7dasf9das87f6dasuafagfdahgfyewiqurytqryewqryueqt7283946321948263149816423984761239486328 VERY LONG STRING > </Content>
</xml file>



similar to mail attachments if you will.

0
 
triplebd69Author Commented:
Is maxAllowedContentLength in bytes, or kb?  Still not sure I have a good understanding of why the size needs to double.
0
 
triplebd69Author Commented:
I tried upping maxAllowedContentLength="307200000" like you suggested and still get this error back.
System.Web.Services.Protocols.SoapException: There was an exception running the extensions specified in the config file. ---> Maximum request length exceeded.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

Open in new window

0
 
GeorgeGerguesCommented:
in Bytes
0
 
GeorgeGerguesCommented:
Are you sure that is the correct web.config for the service. and it is not a part of an application ?

0
 
triplebd69Author Commented:
This is the web.config of the app not the webservice
0
 
GeorgeGerguesCommented:
can you post a screen shot of the Application and virtual folders  
also the URL of the web service in relation to the application .


An easier way is to search the folder for all web.config files and see if you have more than one.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now