Skip to main content
Question

HTTPCaller - Download PDF and keeping the filename

  • February 27, 2020
  • 3 replies
  • 207 views

john_esk
Contributor
Forum|alt.badge.img+7

I'm using the HTTPCaller to download PDF documents to a set destination folder. The files get saved with the following name structure: "http_download_1582786318570_11140". This is not the same name I get when downloading the documents manually in a browser. I need the documents to be saved with the same name I get when doing it manually. Example: "Askholmen_SE0220343". Is it possible?

Website: https://www.lansstyrelsen.se/sodermanland/natur-och-landsbygd/aktiviteter-och-ingrepp-i-naturen/tillstand-i-natura-2000-omrade.html

(URL to PDF-documents are found under the heading "Bevarandeplaner kommunvis")

HTTPCaller:

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

warrendev
Enthusiast
Forum|alt.badge.img+26
  • Enthusiast
  • February 27, 2020

Using the method @david_r suggested, I have attached an example workspace that will get the filename from the Content-Disposition and write out the pdf file using the filename.

 

httpcaller_pdf.fmw

 

2020-02-27-8-23-23 

 

 


david_r
Celebrity
  • February 27, 2020

Using the method @david_r suggested, I have attached an example workspace that will get the filename from the Content-Disposition and write out the pdf file using the filename.

 

httpcaller_pdf.fmw

 

2020-02-27-8-23-23 

 

 

Nice! :-) Just make sure to remove the _response_body attribute containing the PDF if you need to do any further processing after the AttributeFileWriter.

You can also use the ListSearcher as an alternative to the ListExploder + Tester:

 


warrendev
Enthusiast
Forum|alt.badge.img+26
  • Enthusiast
  • February 27, 2020

Nice! :-) Just make sure to remove the _response_body attribute containing the PDF if you need to do any further processing after the AttributeFileWriter.

You can also use the ListSearcher as an alternative to the ListExploder + Tester:

 

That is probably the better way to go about it using the list searcher.