Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anil singh Gurjar
Multiple file Upload using Liferay.Upload
April 12, 2013 12:59 AM
Answer

Anil singh Gurjar

Rank: New Member

Posts: 18

Join Date: October 31, 2011

Recent Posts

I have tried Multiple file Upload using this Link but it's not working for me.
I can select Multiple files but my action class never called. how i can get files in action class. i don't have to store those files in Document Library.


Please sugges some help.
Thanks
Apoorva Prakash
RE: Multiple file Upload using Liferay.Upload
April 13, 2013 7:30 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Anil singh Gurjar:
I have tried Multiple file Upload using this Link but it's not working for me.
I can select Multiple files but my action class never called. how i can get files in action class. i don't have to store those files in Document Library.

Please sugges some help.
Thanks


Hello Anil,

This code is missing the tempURL section.

 1<aui:script use="liferay-upload">
 2        new Liferay.Upload(
 3            {
 4                allowedFileTypes: '<%= allowedFileExtensions %>',
 5                container: '#<portlet:namespace />fileUpload',
 6                deleteFile: '<liferay-portlet:actionURL doAsUserId="<%= user.getUserId() %>"><portlet:param name="struts_action" value="/document_library/edit_file_entry" /><portlet:param name="<%= Constants.CMD %>" value="<%= Constants.DELETE_TEMP %>" /><portlet:param name="folderId" value="<%= String.valueOf(folderId) %>" /></liferay-portlet:actionURL>&ticketKey=<%= ticket.getKey() %><liferay-ui:input-permissions-params modelName="<%= DLFileEntryConstants.getClassName() %>" />',
 7                fileDescription: '<%= StringUtil.merge(PrefsPropsUtil.getStringArray(PropsKeys.DL_FILE_EXTENSIONS, StringPool.COMMA)) %>',
 8                maxFileSize: '<%= PrefsPropsUtil.getLong(PropsKeys.DL_FILE_MAX_SIZE) %> B',
 9                metadataContainer: '#<portlet:namespace />commonFileMetadataContainer',
10                metadataExplanationContainer: '#<portlet:namespace />metadataExplanationContainer',
11                namespace: '<portlet:namespace />',
12                tempFileURL: {
13                    method: Liferay.Service.DL.DLApp.getTempFileEntryNames,
14                    params: {
15                        groupId: <%= scopeGroupId %>,
16                        folderId: <%= folderId %>,
17                        tempFolderName: 'com.liferay.portlet.documentlibrary.action.EditFileEntryAction'
18                    }
19                },
20                uploadFile: '<liferay-portlet:actionURL doAsUserId="<%= user.getUserId() %>"><portlet:param name="struts_action" value="/document_library/edit_file_entry" /><portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ADD_TEMP %>" /><portlet:param name="folderId" value="<%= String.valueOf(folderId) %>" /></liferay-portlet:actionURL>&ticketKey=<%= ticket.getKey() %><liferay-ui:input-permissions-params modelName="<%= DLFileEntryConstants.getClassName() %>" />'
21            }
22        );
23    </aui:script>


HTH.

Thanks and Regards,
Apoorva Prakash
Anil singh Gurjar
RE: Multiple file Upload using Liferay.Upload
April 15, 2013 3:42 AM
Answer

Anil singh Gurjar

Rank: New Member

Posts: 18

Join Date: October 31, 2011

Recent Posts

Thanks Apoorva for Quick Reply
I have tried also with tempUrl. but it's not working for me. Have your tried that code any custom portlet.

With tempUrl it's giving js error that is :Liferay.Service.DL is undefined

Thanks

Anil singh Gurjar
Apoorva Prakash
RE: Multiple file Upload using Liferay.Upload
April 15, 2013 8:01 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Anil singh Gurjar:
Thanks Apoorva for Quick Reply
I have tried also with tempUrl. but it's not working for me. Have your tried that code any custom portlet.

With tempUrl it's giving js error that is :Liferay.Service.DL is undefined

Thanks

Anil singh Gurjar


Sorry, my mistake Anil...

I forgot to mention that you need to import the following in your JSP

1<script src="/html/js/liferay/service.js" language="JavaScript">


HTH.

Thanks and Regards,
Apoorva Prakash
Apoorva Prakash
RE: Multiple file Upload using Liferay.Upload
April 15, 2013 8:37 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hey Anil,

See this forum post also, it may also fit in your requirements.

HTH.

Thanks and Regards,
Apoorva Prakash
Hung Quang
RE: Multiple file Upload using Liferay.Upload
May 13, 2013 3:42 AM
Answer

Hung Quang

Rank: New Member

Posts: 11

Join Date: April 8, 2013

Recent Posts

Apoorva Prakash:
Anil singh Gurjar:
Thanks Apoorva for Quick Reply
I have tried also with tempUrl. but it's not working for me. Have your tried that code any custom portlet.

With tempUrl it's giving js error that is :Liferay.Service.DL is undefined

Thanks

Anil singh Gurjar


Sorry, my mistake Anil...

I forgot to mention that you need to import the following in your JSP

1<script src="/html/js/liferay/service.js" language="JavaScript">


HTH.

Thanks and Regards,
Apoorva Prakash


thanks you verry much!
Apoorva Prakash
RE: Multiple file Upload using Liferay.Upload
May 13, 2013 11:21 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hung Quang:
Apoorva Prakash:
Anil singh Gurjar:
Thanks Apoorva for Quick Reply
I have tried also with tempUrl. but it's not working for me. Have your tried that code any custom portlet.

With tempUrl it's giving js error that is :Liferay.Service.DL is undefined

Thanks

Anil singh Gurjar


Sorry, my mistake Anil...

I forgot to mention that you need to import the following in your JSP

1<script src="/html/js/liferay/service.js" language="JavaScript">


HTH.

Thanks and Regards,
Apoorva Prakash


thanks you verry much!


Welcome!
Ankit _
RE: Multiple file Upload using Liferay.Upload
July 4, 2013 9:57 PM
Answer

Ankit _

Rank: Junior Member

Posts: 46

Join Date: October 18, 2012

Recent Posts

Hi Apoorva Prakash and All,

I am trying to do multiple file upload in liferay, and i can able to do that as above post.
but problem is the file upload tag and other things render on the top left corner of the page, rather then into portlet.

Is there something missing ?

Thanks,
Ankit
Apoorva Prakash
RE: Multiple file Upload using Liferay.Upload
July 4, 2013 10:00 PM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Ankit _:
Hi Apoorva Prakash and All,

I am trying to do multiple file upload in liferay, and i can able to do that as above post.
but problem is the file upload tag and other things render on the top left corner of the page, rather then into portlet.

Is there something missing ?

Thanks,
Ankit


It will be simply some HTML or CSS problem.

Install firebug in Mozilla FF, and try to debug using that...

HTH.

Thanks and Regards,
Apoorva Prakash
Ankit _
RE: Multiple file Upload using Liferay.Upload
July 4, 2013 10:36 PM
Answer

Ankit _

Rank: Junior Member

Posts: 46

Join Date: October 18, 2012

Recent Posts

Hi Apoorva Prakash,

I don't know what's the problem is, it doesn't rendering into "_War_Name_fileupload" id div, just rendering into top div on the page who has id someting "aui_3_7_3_1_206" .

In Liferay.Upload() we specifies the : " container: '#<portlet:namespace/>fileUpload' " ,
Is there any other property , where it get perticular div where it have to render ?

I can't figure it out, as all looks well.
EDIT :
Is that possible AUI script call first , and then page is rendering ?


Thanks,
Ankit
Enrique Valdes Lacasa
RE: Multiple file Upload using Liferay.Upload
July 22, 2015 12:25 PM
Answer

Enrique Valdes Lacasa

Rank: Junior Member

Posts: 68

Join Date: July 29, 2014

Recent Posts

Check this stack overflow thread, Ankit:
https://stackoverflow.com/questions/28109560/liferay-upload-component-usage-for-multi-file-upload
The user Ashok Felix provides an interesting answer that could help (including also a fix for the relocation of the div element).