Download all attachments?!

  • 21 February 2018
  • 5 replies
  • 104 views

Badge +9

Is there a way that I can add a link or a JS code on a Nintex 2013 form to give the user the ability to download all attachments within the form? Some attachment fields can include up to 20 documents and the users want to be able to download all at once.. Is there a way to do without having to write custom code on sharepoint?


5 replies

Userlevel 5
Badge +14

as far as I know there is not such possibility OOTB within forms.

but you could workaround it easily following way.

all the attachments are stored in a hidden Attachments library. so can build a link that points to the library resp. single item's attachments on your own.

the link should look like this

file://<List URL>/Attachments/<Item ID>

when you click such a link, file browser should pop up and you should see all the item's attachments. from there you can copy ones that you need.

Badge +7

Hi Marian, 

I tried this but can't see any items in this hidden library. I know for for a fact there are items in this library, because there are items with attachments in the list. When I click on an attachment, the following url is displayed:

http://<List URL>/Attachments/<Item ID>/<Attachment name>

How does this work exactly?



Userlevel 5
Badge +14

first of all protocol specifier makes the difference.

if you use http, browsers try to interpret it as a regular page and tries to render it.

at second, different browsers might behave differently.

just a quick reserch

IEchrome
httpopens <ItemID>'s  sharepoint folder view for itemsreports 'Page not found'
fileopens windows explorer with <ItemID>'s folder content (attachemnts)opens in a folder browser mode (like for a FTP site)

see some examples - eg. chrome

216297_pastedImage_1.png

windows explorer

216298_pastedImage_2.png

Badge +9

 My 2 cents on that is, if you try to access the attachments library from the browser, you won't be able to see anything. 

But if you access the library/list through SharePoint designer -> all files -> your list-> attachments folder then you will be able to see a folder for each item ID created in the list. Those folders contain the attachments.

For an answer to the original question, we had to write a JavaScript code that will lookup all the attachments URLs that are being placed in a Multiple line of text field (rich text), loops through those urls, fetches the documents and zips them then downloads to the user's local machine. There was no other way OOTB to do that. 

Userlevel 5
Badge +14

I would be incredibly interested in a blog post describing how you were able to accomplish this, if it is at all possible. 

Certain future requirements make it seem as if it's knowledge that could be super useful. 


Reply