[Multiple File Upload] Larger files failing to upload
Forge component by Hugo Pinheiro

Hi guys. Really like this file uploader. I had everything working in my DEV environment. After deploying to production it works but has problems with larger files > 7mb. My production environment has a load balancer. So I suspect that larger files with the load balancer have an issue.


At any point is there some kind of file chunking going on? Is there any issues you are aware of with a load balancer ? At the present time I don't actually need more than 7 mb but I probably will in the future. I did test the demo page in production to check and it has the same file size issue. Any suggestions ?

I forgot to add. When it fails , appears to upload to 100% then hangs there file awhile then just stops without any error in the app. There is a time out error in the log though. One that  says thread being aborted and one that says request timed out.


Message:Thread was being aborted.
Environment InformationeSpaceVer: 2 (Id=389, PubId=720, CompiledWith=9.0.1.40)
RequestUrl: https://webapps.dirtt.net/MultipleFileUpload/Upload.aspx?sessionid=MultipleFileUpload&qqsize=13475328&qqfile=ScheduleDumpSept26.xlsx (Method: POST)
AppDomain: /LM/W3SVC/1/ROOT/MultipleFileUpload-182-131242284136155869
FilePath: d:\OutSystems\Platform Server\running\MultipleFileUpload.02077480094\ProcessFiles.aspx
Locale: en-US
DateFormat: MM-dd-yyyy
PID: 3596 ('w3wp', Started='4/5/2016 9:19:36 AM', Priv=1499Mb, Virt=19810Mb)
TID: 583
Thread Name:
.NET: 4.0.30319.34209
Stack:Thread was being aborted.
   at System.Web.UnsafeNativeMethods.EcbGetAdditionalPostedContent(IntPtr pECB, Byte[] bytes, Int32 offset, Int32 bufferSize)
   at System.Web.Hosting.ISAPIWorkerRequestInProc.GetAdditionalPostedContentCore(Byte[] bytes, Int32 offset, Int32 bufferSize)
   at System.Web.Hosting.ISAPIWorkerRequest.ReadEntityBody(Byte[] buffer, Int32 offset, Int32 size)
   at System.Web.HttpRequest.GetEntireRawContent()
   at System.Web.HttpRequest.get_InputStream()
   at System.Web.HttpRequest.SaveAs(String filename, Boolean includeHeaders)
   at OutSystems.NssMultipleFileUpload_Extension.CssMultipleFileUpload_Extension.MssGetRequestFile(RCFileRecord& ssContent)
   at ssMultipleFileUpload.RssExtensionMultipleFileUpload_Extension.MssGetRequestFile(HeContext heContext, IRecord& outParamContent)

Anything guys? I'm kind of struggling with this one and I can't even debug because it only occurs in production. Anyone have experience using this espace with a load balancer? Problems with larger files?

Can I also upload excel or word files ? I did upload but it's not successful .. If you have any suggestion please help me Sir. Thx you. (:

Yes you can upload excel and word files.


If you have a separate problem mine then please start a new thread.

Mark does the same 7mb file have issues in your dev environment? I'm wondering if you are running into either an HTTP request timeout limit or a webserver file upload size limit, and it may have nothing to do with this component. Just a thought, not sure.


Mark Jurkovich wrote:

Yes you can upload excel and word files.


If you have a separate problem mine then please start a new thread.



Cody Ahlquist wrote:

Mark does the same 7mb file have issues in your dev environment? I'm wondering if you are running into either an HTTP request timeout limit or a webserver file upload size limit, and it may have nothing to do with this component. Just a thought, not sure.


Mark Jurkovich wrote:

Yes you can upload excel and word files.


If you have a separate problem mine then please start a new thread.




Hi Cody. I don't have problems with large files in DEV. Only in production. I am on Outsystems Paas so I am not sure if I have control over any timeout settings. My production environment has a load balancer which may be complicating things.

After the temp upload I am sending to amazon s3. I see in another thread someone is trying to upload straight to amazon. I might try the same thing.

Mark Jurkovich wrote:

Cody Ahlquist wrote:

Mark does the same 7mb file have issues in your dev environment? I'm wondering if you are running into either an HTTP request timeout limit or a webserver file upload size limit, and it may have nothing to do with this component. Just a thought, not sure.


Mark Jurkovich wrote:

Yes you can upload excel and word files.


If you have a separate problem mine then please start a new thread.




Hi Cody. I don't have problems with large files in DEV. Only in production. I am on Outsystems Paas so I am not sure if I have control over any timeout settings. My production environment has a load balancer which may be complicating things.

After the temp upload I am sending to amazon s3. I see in another thread someone is trying to upload straight to amazon. I might try the same thing.

Lol. Okay i see now that its you trying to upload straight to amazon. Let me know if it works out!


Any update on this?

I'm experiencing the same issue.  The progress goes to 100% but the temp file that is uploaded is empty if the upload takes longer than ~2 minutes.  Doesn't matter what size the file is.  I tested by throttling my connection and uploading a 2MB file that took just over 2 minutes and the same issue occurred.

Upgrading to latest version of the component did not resolve the issue.  Chrome network inspector shows a HTTP 500 error thrown.

Any tips as to what could be causing the issue? Component or server perhaps?

i am getting same issue.


any solutions ?

hi,

after doing the following i have been able to upload files up to 1 GB


Solution to large file upload

  • Configure maxRequestLength, timeout in machine.config in the directory C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
  •     <httpRuntime executionTimeout="3600" maxRequestLength="1782579" />

  • If maxAllowedContentLength does not exist in web.config, add the following configuration

<system.webServer>

          <security>

                 <requestFiltering>

                        <requestLimits maxAllowedContentLength="1825361100" />

                 </requestFiltering>

          </security>

   </system.webServer>

  • In C:\Windows\System32\inetsrv\config\applicationHost.config, modify maxRequestEntityAllowed and uploadReadAheadSize values (same as maxAllowedContentLength)

<serverRuntime maxRequestEntityAllowed="1825361100" uploadReadAheadSize="1825361100" />


  • In Factory Configuration module do the following steps:

Shared Configurations tab -> Create New Shared Configuration

https://serverName/FactoryConfiguration/ListSharedConfigurations.aspx

select web.config_XSL type


Then add the following configuration for maxRequestLength, executionTimeout, and maxAllowedContentLength)


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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>


  <!--

      Description

      This xslt is used to add uploading of large files capabilities to a outsystems eSpace on IIS.

      - It will upsert the attribute system.web/httpRuntime/@maxRequestLength (<=IIS6).

      - It will upsert the attribute system.webServer/security/requestFiltering/requestLimits/@maxAllowedContentLength (>=IIS7).

  -->


  <!-- Just copy all other xml parts, that don't have a specific template match. -->

  <xsl:template match="@*|node()">

    <xsl:copy>

      <xsl:apply-templates select="@*|node()"/>

    </xsl:copy>

  </xsl:template>


  <xsl:template match="configuration">

<!-- Create an "configuration" element in the output document. -->

<configuration>

   

    <!-- Copy child elements to output document. -->

    <xsl:apply-templates select="@*|node()"/>


    <!-- If the element "system.web" does not exist, create it in the output document. -->

    <xsl:if test="count(system.web) = 0">

      <system.web>

        <httpRuntime maxRequestLength="1782579"  executionTimeout="3600" />

      </system.web>

    </xsl:if>  


    <!-- If the element "system.webServer" does not exist, create it in the output document. -->

    <xsl:if test="count(system.webServer) = 0">

    <system.webServer>

        <security>

            <requestFiltering>

                <requestLimits maxAllowedContentLength="1825361100"/>

            </requestFiltering>

        </security>

    </system.webServer>

    </xsl:if>

</configuration>

  </xsl:template>


  <!-- If the element "system.web/httpRuntime" does not exist, add it. -->

  <xsl:template match="system.web[not(httpRuntime)]">

    <system.web>

      <xsl:apply-templates select="@*|node()"/>

      <httpRuntime maxRequestLength="1782579" executionTimeout="3600" />

    </system.web>

  </xsl:template>


  <!-- If the attribute "system.web/httpRuntime/@maxRequestLength" does not exist, add it. -->

  <xsl:template match="system.web/httpRuntime[not(@maxRequestLength)]">

    <xsl:copy>

      <xsl:apply-templates select="@*|node()"/>

      <xsl:attribute name="maxRequestLength">

        <xsl:value-of select="'1782579'"/>

      </xsl:attribute>

     <xsl:attribute name="executionTimeout">

      <xsl:value-of select="'3600'"/>

    </xsl:attribute>

    </xsl:copy>

  </xsl:template>

 

  <!-- If the attribute "system.web/httpRuntime/@maxRequestLength" exists update it. -->

  <xsl:template match="system.web/httpRuntime/@maxRequestLength">

    <xsl:attribute name="maxRequestLength">

      <xsl:value-of select="'1782579'"/>

    </xsl:attribute>

   <xsl:attribute name="executionTimeout">

      <xsl:value-of select="'3600'"/>

    </xsl:attribute>

  </xsl:template>


  <!-- If the element "system.webServer/security" does not exist, add it. -->

  <xsl:template match="system.webServer[not(security)]">

    <system.webServer>

      <xsl:apply-templates select="@*|node()"/>

      <security>

        <requestFiltering>

          <requestLimits maxAllowedContentLength="1825361100"/>

        </requestFiltering>

      </security>

    </system.webServer>

  </xsl:template>


  <!-- If the element "system.webServer/security/requestFiltering" does not exist, add it. -->

  <xsl:template match="system.webServer/security[not(requestFiltering)]">

    <security>

      <xsl:apply-templates select="@*|node()"/>

        <requestFiltering>

          <requestLimits maxAllowedContentLength="1825361100"/>

        </requestFiltering>

    </security>

  </xsl:template>


  <!-- If the element "system.webServer/security/requestFiltering/requestLimits" does not exist, add it. -->

  <xsl:template match="system.webServer/security/requestFiltering[not(requestLimits)]">

    <requestFiltering>

      <xsl:apply-templates select="@*|node()"/>

        <requestLimits maxAllowedContentLength="1825361100"/>

    </requestFiltering>

  </xsl:template>


  <!-- If the attribute "system.webServer/security/requestFiltering/requestLimits/@maxAllowedContentLength" does not exist, add it. -->

  <xsl:template match="system.webServer/security/requestFiltering/requestLimits[not(@maxAllowedContentLength)]">

    <xsl:copy>

      <xsl:apply-templates select="@*|node()"/>

      <xsl:attribute name="maxAllowedContentLength">

        <xsl:value-of select="'1825361100'"/>

      </xsl:attribute>

    </xsl:copy>

  </xsl:template>


  <!-- If the attribute "system.webServer/security/requestFiltering/requestLimits/@maxAllowedContentLength" exists update it. -->

  <xsl:template match="system.webServer/security/requestFiltering/requestLimits/@maxAllowedContentLength">

    <xsl:attribute name="maxAllowedContentLength">

      <xsl:value-of select="'1825361100'"/>

    </xsl:attribute>

  </xsl:template>


</xsl:stylesheet>


Useful Links:

https://www.outsystems.com/forums/discussion/37130/not-able-to-upload-video-that-more-than-150mb/

https://www.outsystems.com/forums/discussion/70771/error-uploading-large-file-size-gt-600mb-using-multiplefileupload-component/#

https://stackoverflow.com/questions/63833894/iis-uploadreadaheadsize-value-meaning

https://docs.microsoft.com/en-us/iis/configuration/system.webserver/serverruntime

https://forums.iis.net/t/1217850.aspx

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.