Fórumok

File.Upload limit number of files

Morad Ahmad, módosítva 9 év-val korábban

File.Upload limit number of files

Junior Member Bejegyzések: 71 Csatlakozás dátuma: 2010.06.16. Legújabb bejegyzések
I need for my portal to allaw default users to upload maximum of 10 images. For Uploading images I use the Alloy funtion

<aui:script use="liferay-upload">
new Liferay.Upload({
boundingBox: '#<portlet:namespace />fileUpload',
namespace: '<portlet:namespace />',
uploadFile: '<liferay-portlet:actionURL name="addTempAttachment" doAsUserId="<%= user.getUserId() %>"><portlet:param name="albumId" value="<%= String.valueOf(albumId) %>" /></liferay-portlet:actionURL>&ticketKey=<%= ticket.getKey() %><liferay-ui:input-permissions-params modelName="<%= DLFileEntryConstants.getClassName() %>" />',
deleteFile: '<liferay-portlet:actionURL name="deleteTempAttachment" doAsUserId="<%= user.getUserId() %>"></liferay-portlet:actionURL>&ticketKey=<%= ticket.getKey() %><liferay-ui:input-permissions-params modelName="<%= DLFileEntryConstants.getClassName() %>" />',
fileDescription: '<%= StringUtil.merge(PrefsPropsUtil.getStringArray(PropsKeys.DL_FILE_EXTENSIONS, StringPool.COMMA)) %>',
maxFileSize: '<%= maxImageSize %> B',
metadataContainer: '#<portlet:namespace />selectedFileNameMetadataContainer',
metadataExplanationContainer: '#<portlet:namespace />metadataExplanationContainer'
}
);

</aui:script>

I can limit the filesize but not the maximum number of files to upload.

How to realize that? In the portlet class action method? Or is there any option to configure it?

Thanks,
Morad.