765
Views
10
Comments
Solved
Download binary Data from URL
Application Type
Traditional Web, Reactive
Service Studio Version
11.53.42 (Build 62025)

Hi Community,

I have URL in response from an API which can be used to download a file but, when I open this URL it starts downloading in local PC but I want its binary in service studio.

Please help me out.

Thanks!

2023-03-16 04-58-56
Ashish Lonkar
Solution

Hi Veena,

Please try this project.

Thanks AWL!

Forum.oap
2023-03-16 04-58-56
Ashish Lonkar

Hi Veena,

Can you share the OML ?

Thanks AWL

UserImage.jpg
Veena L

Hi Ashish,

Sorry It's in company's environment, I won't be able to do that.

Thanks!

2023-03-16 04-58-56
Ashish Lonkar

Hi Veena,

please check this thread, It is very similar

https://www.outsystems.com/forums/discussion/75806/get-binary-file-from-url/

Thanks AWL!

UserImage.jpg
Veena L

Hi Ashish,

This is not working for me.

Any alternatives ?

Thanks!

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Veena,

It's not clear to me what you want. You write "when I open this URL it starts downloading in local PC but I want its binary in service studio", but what exactly did you do? What code did you write "open the URL"? Also, you say "I want the binary in Service Studio", but Service Studio is a design-time tool, not the run-time environment, so what do you mean?

2023-01-13 06-51-46
William Tandwe

Hi Veena


In the HTTPRequestHandler extension, there is an action called GetRequest_Submit. If you provide it with a download URL it returns the data as Binary Data. 

If your URL immediately downloads to your PC then put that URL in this action and it will return the Binary Data.

Hope this solves your problem

2022-02-25 19-42-59
Srinivas K Singadi
AI Generated

Hello Veena L 

If understood your question correctly then 

you can use the "HTTP Request" action from the "HTTP" module. 

Steps

  • Drag and drop the "HTTP Request" action onto your OutSystems flow.
  • Configure the action as follows:
  • Method: GET
  • URL: the URL you received in the API response
  • Headers: if there are any headers required for authentication or authorization
  • Output Type: Binary
  • Assign the output of the "HTTP Request" action to a variable of type Binary.
  • For example, you can create a local variable of type Binary in your OutSystems flow, and assign the output of the "HTTP Request" action to it.
  • You can then use the binary data in your OutSystems application as needed. For example, you can display an image or PDF in a web block or download the file to the user's device.
  • To display an image or PDF, you can use an "Image" or "PDF Viewer" widget, respectively, and set the "Content" property to the binary variable you created.To download the file to the user's device, you can use the "Download" widget and set the "Content" property to the binary variable you created. You may also need to set the "Filename" property to give the downloaded file a name.

Note that downloading binary data can take up a lot of memory and bandwidth, so you should be mindful of the size of the files you're downloading and the impact it may have on the performance of your application

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2023-03-16 04-58-56
Ashish Lonkar
Solution

Hi Veena,

Please try this project.

Thanks AWL!

Forum.oap
2023-03-16 04-58-56
Ashish Lonkar

Note : In this project, from the API response you can extract binary file if you don't want to use in the download widget.

Thanks AWL! 

UserImage.jpg
Veena L

Hi Ashish,

This worked for me.

Thanks!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.