Downloadable attachments

Enonic version: 6.5.2
OS: 15.10 Ubuntu

Is it possible to get attachmentUrl for each result from the getAttachments below and make it downloadable to users ?

var result = contentLib.getAttachments(content._path);

Yes, you can call attachmentUrl() function in lib-portal.

Pass the content._path (or _id) and the attachment name to the attachmentUrl function.
Something like this:

var portalLib = require('/lib/xp/portal');

var attachments = contentLib.getAttachments(content._path);
for (var attachId in attachments) {
  var attachmentUrl = portalLib.attachmentUrl({
    path: content._path,
    name: attachments[attachId].name,
    download: true

Spot on!

Thx for that aro. It worked just fine.