Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Rahul Jaiswal
How to print custom validation message in multiple upload control?
November 8, 2012 12:12 AM
Answer

Rahul Jaiswal

Rank: New Member

Posts: 9

Join Date: July 6, 2011

Recent Posts

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.