0

We create a pdf-download URL in our Liferay Portal 6.1 EE via following method call:

String fileUrl = DLUtil.getPreviewURL(file, fileVersion, null, StringPool.BLANK, false, true);

Is it possible to remove the generated "number-letter-combination" (bold text) from the link or place it at a certain point in the url ?

documents/10180/1423151/AT0000753173_FAT.pdf/461a1fdf-6e61-4cb3-8c1d-77cb527e3609

Thanks a lot for any hints.

HelmutSteiner
  • 99
  • 2
  • 11

1 Answers1

0

the "number-letter-combination" is the file uuid field and there is no way to move that calling the method DLUtil.getPreviewURL. But you can build the url yourself in this way

    StringBundler sb = new StringBundler();
    sb.append(PortalUtil.getPathContext());
    sb.append("/documents/");
    sb.append(fileEntry.getRepositoryId());
    sb.append(StringPool.SLASH);
    sb.append(fileEntry.getFolderId());
    sb.append(StringPool.SLASH);
    sb.append(HttpUtil.encodeURL(HtmlUtil.unescape(fileEntry.getTitle())));
    fileUrl = sb.toString()
Romeo Sheshi
  • 901
  • 5
  • 7