afraIT Shorty-Time! Just want to share a little script on how to get the attachment url or the attachment filename of an list item in SharePoint 2013.

There is often the request, that someone wants to get the complete URL of an uploaded document, picture or whatever.

Here it is, a short javascript with a little REST in it:

The script is pretty easy. The big point here is the requestUri. You have to select the Attachments and the AttachmentFiles. After that you can append the expand and select the AttachmentFiles.

Then you can show either the FilesName or the URL. You can see the alert’s which are commented out in line 19 and 20.

Hope this can help you a little bit. If you like the Shorty-Section, click here to get more of those and if you like it, share it or follow me on twitter or facebook.

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here