jsffile-uploadtomahawk

t:inputFileUpload not submitting form when large file is submitted


I am using fileupload component from tomahawk as shown below:

<t:inputFileUpload id="uploadFile" storage="file" size="60" value="#{"bean.uploadedFile}" />

web.xml has the filter defined as

  <filter>
        <filter-name>Extensions Filter</filter-name>
        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>5g</param-value>
        </init-param>
        <init-param>
            <param-name>uploadThresholdSize</param-name>
            <param-value>5m</param-value>
        </init-param>
    </filter>

Also, form encoding type is set as "multipart/form-data" and is submitted using "h:commandButton".

Now, when I provide file of size greater than 1 GB, form submit do not happen at all. Also, I don't see any error/exception on the console. Files below 1 GB gets uploaded successfully.

Another strange behavior is, if I reduce "uploadMaxFileSize" to "3g", even 1 GB file fails to upload but 512 MB gets uploaded successfully.

I am struggling with this for couple of days. Please let me know, if anyone knows about this.


Solution

  • Specify uploadMaxFileSize in MB rather than GB. If I specify it to 2000m, it picks up correctly and allow files up to 2GB to upload but if the same value is specified as 2g, it is not working.

    This might be a bug in t:inputFileUpload component as to how they are validating file size.