title: Liferay.Upload Component Usage for Multi-file Upload
body: <p>Developing a custom portlet to upload multiple files in Liferay 6.2.
  Found the Liferay.Upload component while going through Liferay Source Code in the Document Library Portlet at the following location:</p>
  
  <p><a href="https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/document_library/upload_multiple_file_entries.jsp" rel="nofollow">https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/document_library/upload_multiple_file_entries.jsp</a> </p>
  
  <p>We want to reuse this component, but unable to find any documentation regarding the usage. </p>
  
  <ol>
  <li>How do we use the <code>Liferay.Upload</code> component? What do each of the inputs mean &amp; do?</li>
  <li>Can we re-use this <code>Liferay.Upload</code> in our custom portlet?</li>
  <li>Any concrete documentation on the usage of <code>Liferay.Upload</code>?</li>
  <li>Any already implemented portlets available on the web with the Source Code available on the web?</li>
  </ol>
  
  <p>Given below is the extract of the usage of the Liferay Upload component:</p>
  
  <pre><code>&lt;aui:script use="liferay-upload"&gt;
      new Liferay.Upload(
          {
              boundingBox: '#&lt;portlet:namespace /&gt;fileUpload',
              deleteFile: '&lt;liferay-portlet:actionURL doAsUserId="&lt;%= user.getUserId() %&gt;"&gt;&lt;portlet:param name="struts_action" value="/document_library/edit_file_entry" /&gt;&lt;portlet:param name="&lt;%= Constants.CMD %&gt;" value="&lt;%= Constants.DELETE_TEMP %&gt;" /&gt;&lt;portlet:param name="folderId" value="&lt;%= String.valueOf(folderId) %&gt;" /&gt;&lt;/liferay-portlet:actionURL&gt;&amp;ticketKey=&lt;%= ticket.getKey() %&gt;&lt;liferay-ui:input-permissions-params modelName="&lt;%= DLFileEntryConstants.getClassName() %&gt;" /&gt;',
              fileDescription: '&lt;%= StringUtil.merge(PrefsPropsUtil.getStringArray(PropsKeys.DL_FILE_EXTENSIONS, StringPool.COMMA)) %&gt;',
              maxFileSize: '&lt;%= PrefsPropsUtil.getLong(PropsKeys.DL_FILE_MAX_SIZE) %&gt; B',
              metadataContainer: '#&lt;portlet:namespace /&gt;commonFileMetadataContainer',
              metadataExplanationContainer: '#&lt;portlet:namespace /&gt;metadataExplanationContainer',
              namespace: '&lt;portlet:namespace /&gt;',
              tempFileURL: {
                  method: Liferay.Service.bind('/dlapp/get-temp-file-entry-names'),
                  params: {
                      groupId: &lt;%= scopeGroupId %&gt;,
                      folderId: &lt;%= folderId %&gt;,
                      tempFolderName: 'com.liferay.portlet.documentlibrary.action.EditFileEntryAction'
                  }
              },
              tempRandomSuffix: '&lt;%= EditFileEntryAction.TEMP_RANDOM_SUFFIX %&gt;',
              uploadFile: '&lt;liferay-portlet:actionURL doAsUserId="&lt;%= user.getUserId() %&gt;"&gt;&lt;portlet:param name="struts_action" value="/document_library/edit_file_entry" /&gt;&lt;portlet:param name="&lt;%= Constants.CMD %&gt;" value="&lt;%= Constants.ADD_TEMP %&gt;" /&gt;&lt;portlet:param name="folderId" value="&lt;%= String.valueOf(folderId) %&gt;" /&gt;&lt;/liferay-portlet:actionURL&gt;&amp;ticketKey=&lt;%= ticket.getKey() %&gt;&lt;liferay-ui:input-permissions-params modelName="&lt;%= DLFileEntryConstants.getClassName() %&gt;" /&gt;'
          }
      );
  &lt;/aui:script&gt;
  </code></pre>
  
  <p>Any pointers are highly appreciated!!</p>