Fórum

Document and Media Display direct download on click

thumbnail
Trini Dev, modificado 9 Anos atrás.

Document and Media Display direct download on click

Junior Member Postagens: 35 Data de Entrada: 23/04/14 Postagens Recentes
Hi All,

I wanted to know if it is possible in Liferay 6.1 to have a direct download once you click on a document in within the Document library display.
I do not want to have the preview option. I looked at editing the view_file_entries.jspf but it didn't work.
Thanks,
Trini_Dev
Michael Lautenschläger, modificado 8 Anos atrás.

RE: Document and Media Display direct download on click

New Member Postagens: 14 Data de Entrada: 03/12/15 Postagens Recentes
I know it's an old post, but i had the same problem, and this may help others:

1. create hook in liferay ide (create hook)
2. custom jsp - add htlm/portlet/document_library/view_file_entries.jspf
3. on line 118 add:

if(!permissionChecker.isOmniadmin()){
FileVersion fileVersion = fileEntry.getFileVersion();
String previewURL = DLUtil.getPreviewURL(fileEntry, fileVersion, themeDisplay, StringPool.BLANK);
String downloadURL = HttpUtil.addParameter(previewURL, "download", true);
rowHREF = downloadURL;}
else{// old code}

So now only the admin sees the view_file_entry.jsp
4.deploy