Skip to main content
Question

HTTPCaller - Download PDF and keeping the filename

  • February 27, 2020
  • 3 replies
  • 115 views

john_esk
Contributor
Forum|alt.badge.img+6

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:

3 replies

warrendev
Enthusiast
Forum|alt.badge.img+23
  • 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
Evangelist
  • February 27, 2020
warrendev wrote:

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+23
  • Enthusiast
  • February 27, 2020
david_r wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings