Customization

File upload destination:

Uploaded files are saved in the fileupload directory in the parent root dirctory. If fileupload directory doesn't exist, File Upload portlet creates a new directory in the root directory.

File upload directory can be configured in the portlet.xml file. Set the value for the portlet init parameter default-upload-location in the portlet.xml.

<init-param>

<name>default-upload-location</name>

<value>/fileupload/</value>

</init-param>

Temporary files upload location:

If Portlet is configured to use chunk upload feature refer to Options. Portlet stories all the chunks in the temp directory. temporary file location can be configured in the portlet.xml as shown below.

<init-param>

<name>default-upload-temp-location</name>

<value>/fileupload/temp/</value>

</init-param>

Default chunks are storied in fileupload/temp location where fileupload is the file destination folder. Once all the chunks are uploaded, file will be named and copied to file upload destination folder.

Caution: We need to create messages for all available keys defined in the utils.js with this approach.

View Templates:

HTML5 File upload plugin is developed using mustache template system. Mustache is a logic-less template syntax, it's very simple to create our own view template and use with this plug-in. This plug-in OOTB provide two templates "previewTemplate.jsp" and "simpleTemplate.jsp" to showcase the use of templates.