Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Manish Kumar Jaiswal
How to get the client side image path being uploaded ?
October 28, 2012 5:32 AM
Answer

Manish Kumar Jaiswal

Rank: Regular Member

Posts: 133

Join Date: November 25, 2008

Recent Posts

Hi all ,

I am using this code snippet to upload the image .

<aui:input label=' ' name="fileName" size="25" type="file" class="photoPopUpCSS"/>

at the serverside I need the path at users Computer where it is loading the file from .what will be the code snippet for this , I am using UploadPortletRequest at server side.

Regards
Manish
Tejas Kanani
RE: How to get the client side image path being uploaded ?
October 28, 2012 11:25 PM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 655

Join Date: January 6, 2009

Recent Posts

Hi Manish,

Try below code,
1final UploadPortletRequest uploadRequst = PortalUtil.getUploadPortletRequest(actionRequest);
2uploadRequst .getParameter("fileName");


Thanks,
Tejas
Jitendra Rajput
RE: How to get the client side image path being uploaded ?
October 28, 2012 11:56 PM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 873

Join Date: January 7, 2011

Recent Posts

You can also try this code.

1 File attachment = uploadRequest.getFile("fileAttachment");
2 String path = attachment .getPath();
Manish Kumar Jaiswal
RE: How to get the client side image path being uploaded ?
October 31, 2012 2:59 AM
Answer

Manish Kumar Jaiswal

Rank: Regular Member

Posts: 133

Join Date: November 25, 2008

Recent Posts

I am still unable to get the Users Computers path . Seems like its a security of the Browsers itself that it do not allow the users computers path to pass through.Can someone conform me if this is the case ????

Regards
Manish
Jitendra Rajput
RE: How to get the client side image path being uploaded ?
October 31, 2012 6:57 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 873

Join Date: January 7, 2011

Recent Posts

Try with different browser if you think its a browser security issue.