Question

HTTPCaller - Download PDF and keeping the filename

  • 27 February 2020
  • 3 replies
  • 14 views

Badge

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

Badge +16

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 

 

 

Userlevel 4

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:

 

Badge +16

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.

Reply