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.
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 responses to “Get Attachment URL from list item (en)”
Hi, this works but the $.each only iterates once with my test that should return 3 attachments. Can you help?
I also only got the first result. That’s how far I came. If you figure out more, any feedback is appreciated.
Nevermind. I figured it out. I had to add a while loop around ‘var attachmentUrl’. Thanks for the example!