Uploading large digital goods file

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
mike92117
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Sat Nov 07, 2009 6:41 pm

Uploading large digital goods file

Post by mike92117 » Sat Dec 10, 2016 8:55 am

I have run into the 4MB issue in the past but simply updated my web.config to allow very large uploads for my digital goods. This has worked fine but I now have a 66 MB file that is failing about 45% into the upload. My largest file prior to this is around 7 MB.

This is my setting in my web.config:
<httpRuntime maxRequestLength="2147483647" executionTimeout="3600" requestValidationMode="2.0" targetFramework="4.5"/>

Any idea why this is happening? I have filled in both "File Name" and "Display Name" fields in the "Add Digital Good" dialog box.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Uploading large digital goods file

Post by mazhar » Tue Dec 13, 2016 4:43 am

maxRequestLength value is given in Kilobytes. For 100MB set maxRequestLength to 100000

User avatar
NC Software
AbleCommerce Partner
AbleCommerce Partner
Posts: 4620
Joined: Mon Sep 13, 2004 6:06 pm
Contact:

Re: Uploading large digital goods file

Post by NC Software » Tue Dec 13, 2016 5:52 am

It's been a long time since I setup my digital goods and I'm not using AC GOLD yet but I think I FTP'd all of my files into the App_Data/DigitalGoods folder (or whatever it's called) and then just referenced them from the digital goods config area.
Neal Culiner
NC Software, Inc.

mike92117
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Sat Nov 07, 2009 6:41 pm

Re: Uploading large digital goods file

Post by mike92117 » Thu Dec 15, 2016 6:16 pm

In the time waiting for a response, I FTPd the file over to the server and then manually populated a new record in the ac_DigitalGoods table. That solved my immediate problem.

I did check and you are right about the max size is specified in KBs so I updated the web.config with the correct value. Note the value I used was based on a few different stackoverflow posts that incorrectly were using bytes, not kilobytes.

This is the line I used (for up to 200 MB):

Code: Select all

<httpRuntime maxRequestLength="200000" executionTimeout="3600" requestValidationMode="2.0" targetFramework="4.5"/>
I tried a new upload of the original 68 MB file and it sure appeared to upload but on completion I get a 404 error code and the file does not appear in App_Data/DigitalGoods folder nor does it show up in the db table. I tried several other files and it seems like anything above approx. 30 MB will fail with a 404.

Here is the solution:

With IIS 7, you need another value in your web.config (see this reference: https://weblogs.asp.net/pscott/404-erro ... -with-iis7):

Code: Select all

    <security>
       <requestFiltering><requestLimits maxAllowedContentLength="200000000" /></requestFiltering> 
	<!-- maxAllowedContentLength is in bytes. Defaults to 30,000,000 -->
    </security>
Warning: the maxRequestLength is in kilobytes. The maxAllowedContentLength is in bytes.

Further information is available at Microsoft: https://www.iis.net/configreference/sys ... uestlimits and I learned that:

The <requestLimits> element of the <requestFiltering> collection was introduced in IIS 7.0.
The exact http status is 404.13, Content Length Too Large because I was not setting it and it defaults to 30 MB when not set.

Hope this helps someone.

Post Reply