Page 1 of 1

Download file from remote server

PostPosted: Tue Apr 05, 2022 3:01 pm
by jdbruijn
Hi,
I've got an API that retrieves a download link for a pdf file from an external party using an API, and I have to pass that file along as the response to another application. The external party returns the file URL in the response body and I want to download it to the server so I can pass it along in the response of my API.

Re: Download file from remote server

PostPosted: Tue Apr 05, 2022 5:17 pm
by mboegem
I guess your question is: how to do this?

Can't you create a GET request with the download link using the HTTP plugin?
Once you get the response, you can get the media data from the response, this should be a byteArray.

Then start a second request to send the file to the other application.

Hope this helps

Re: Download file from remote server

PostPosted: Wed Apr 06, 2022 8:44 am
by jdbruijn
Hi Marc,
Yes that works, thanks!
Did not see the getMediaData for the response. I was looking for a download file option.