1

I'm using SharePoint Online and I'd like to know if it's possible to append a metadata column value to a filename when a user clicks "Download". The filename in SP must stay the same, but the locally downloaded version must be appended.

0

This is not possible out-of-the-box. But one solution could be to customize SharePoint with your own download link at the appropriate location. Use the HTML download attribute on an anchor tag. For example:

<a href="{SPURL}" download="{DownloadFilename}">download</a>

However, it will not work in all browsers. It works with Google Chrome and FireFox whereas Internet Explorer and Microsoft Edge will ignore it.

  • Thanks, but that won't work with the standard download link on libraries will it? I need a solution that works for all links without me having to edit the html each time. Plus, I don't know the filename - so a hard-coded approach won't suffice. – MrShoes Feb 15 '17 at 16:13
  • No, the standard download will use the filename only! You'll have to develop a custom solution. Maybe by registering some JavaScript code (through a CustomAction) that replaces the standard download link! The metadata to add can be retrieved from the web page if available or by a call back to SharePoint with the JSOM. – Lars Fastrup Feb 16 '17 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.