Fórumok

How to print custom validation message in multiple upload control?

thumbnail
Rahul Jaiswal, módosítva 11 év-val korábban

How to print custom validation message in multiple upload control?

New Member Bejegyzések: 10 Csatlakozás dátuma: 2011.07.06. Legújabb bejegyzések
Hello,

I am working on a requirement to upload files and save them on a file server but not in Document Library.

Here I have to check if uploaded file name already exist then user should get a response message like "File already exist." in corresponding upload row.

For example if user is uploading 5 files out of which 2 files already exist on server then user should get "File already exist" message in corresponding 2 rows.

I am using liferay uploader as below:

<liferay-portlet:actionURL doAsUserId="<%=user.getUserId() %>" name="uploadFile" var="uploadFileURL">
</liferay-portlet:actionURL>

<aui:script use="liferay-upload">
new Liferay.Upload({
allowedFileTypes: '*',
container: '#<portlet:namespace />divUploader',
deleteFile: '<portlet:resourceURL />',
maxFileSize: 1024*1024*1024,
tempFileURL: '<portlet:resourceURL />',
namespace:'<portlet:namespace />',
uploadFile: '${uploadFileURL}',
fallbackContainer: '#<portlet:namespace />fallbackContainer'
});
</aui:script>

I just need to know what response I should return from upload action to display "File already exist" message in corresponding row.