I am trying to obtain the full URL of every item's attachments in a sharepoint list

Here is what I am specifically trying to obtain, in bold:



I am trying to find every filename within each item's attachment section.

So far I am pulling it out like so:

var AttachmentPic1 = ListURL + '/Attachments/' + StaffList[i].ID + 'Photo.png';

Which works, but the name of the photo must be predetermined (Photo.png). Is there any way to pull out each attachment name for each item in the list? My end goal is to be able to extract the full URL for each item in the attachments list to display it in HTML

Thanks ahead of time for any help! I'll be nearby if I didn't explain something right


SPServices GetAttachmentCollection will allow you to do this using JQuery.

|improve this answer|||||

Map your list attachments folder as a network drive and then use powershell and run the following script.

Get-ChildItem site.sharepoint.com/sites/mysite/Lists/ContactList/Attachments/ -Recurse | % { $_.FullName } | Out-File C:\Users\username\Desktop\resulsts.txt
|improve this answer|||||

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.