Skip to main content
September 22, 2016
Answered

cannot upload file greater than 2 GB using cffileupload

  • September 22, 2016
  • 1 reply
  • 1720 views

I am able to upload 1 GB file.

However, when I upload 2.2 GB file, it get struck at 99% progress. I don't get any error.

I am running ColdFusion 11 on a Windows Server 2012 R2 machine.

1. In ColdFusion code, I set the file limit to 3.2 GB.

main cfm page:

<cffileupload

   url="uploadFilesProcess.cfm?par1=#STORAGEDIRECTORY#"

   progressbar="true"

   BGCOLOR="##FFFFFF"

   width=500

   height=250

   maxuploadsize=3200

   title = "File Upload" />

uploadFilesProcess.cfm:

<cfset param1 = url['par1'] />

<cffile action="uploadAll" destination="#param1#" nameconflict="overwrite" />

2. In ColdFusion server setting, I set the following:

Max number of POST request para: 3200

Max size of post data: 3200 MB

Request Throttle Threshold: 4 MB

Request Throttle Memory: 3200 MB

3. In Windows IIS filter setting, I set the max allowed content length (Bytes) to 3200000000.

This topic has been closed for replies.
Correct answer BKBK

thanks for replying.

I still cannot upload the 2.2 GB file.

This is what I have:

1.In C:\inetpub\wwwroot\web.config, this is what I have:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <defaultDocument>

            <files>

                <add value="main.cfm" />

            </files>

        </defaultDocument>

        <security>

            <requestFiltering>

                <requestLimits maxAllowedContentLength="3200000000" />

            </requestFiltering>

        </security>

        <directoryBrowse enabled="true" />

    </system.webServer>

    <system.web>

        <authentication mode="Windows" />

    </system.web>

</configuration>

2.In Windows IIS web server filter setting, I set the max allowed content length (Bytes) to 3200000000.

3. C:\Windows\System32\inetsrv\config\applicationHost.config, this is what I have"

   </hiddenSegments>

        <requestLimits maxAllowedContentLength="3300000000" />

   </requestFiltering>


It also appears that 2 GB is an upload limit for most browsers. Try Chrome or Opera.

1 reply

WolfShade
Legend
September 22, 2016

Hi, dzhaos,

The limit could be hardware (ie, if the webserver only has 6Gig of RAM, trying to upload a 2.2Gig file might be an issue because much of the RAM is being used by the server, itself, and CF and the webserver.)

Check the CF documentation to see if the maxuploadsize attribute should be in quotes (ie, "3200" instead of just 3200) and what that number refers to (bytes, megabytes, etc.)

The max number of POST isn't related to file size; it's a maximum number of FORM elements that can be submit at once.  Default is 100 for security reasons.

HTH,

^_^

September 22, 2016

Thanks for the reply.

The server is a VM with 12 GB RAM. I monitored the memory usage during upload process and it never exceed 50%.

Normally 36% RAM is used and during the peak of the upload, 50% of RAM is used.

When upload is struck at 99%, the memory usage is at 36%.

I double checked the maxuploadsize parameter; it is in Megabytes and should be in quote.

David

BKBK
Community Expert
Community Expert
September 22, 2016