306
Views
3
Comments
Solved
Download URL to the database
Question

Hi,


I have a URL to a PDF, that I want to save to my database so I can attache it to an email.

I'm not sure which approach to follow, but I need to save this pdf file from the url in the database to be able to attach it. any idea how?


Thanks,

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Abeer,

You could follow the next approach:

  • Add dependency to GetRequest_Submit from extension HTTPRequestHandler
  • Add the GetRequest_Submit action to you code, the URL input paramet should be filled with the URL that points to the PDF. The Arguments input parameter can be filled with "", the others are optional.
  • As a result the action returns the PDF document as a Binary in the output parameter BinaryContent. The type of the binary is return in BinaryContentType output parameter
  • You can now store this binary in an OutSystems entity with a parameter of type binary.
  • From there it is available for further usage.

Regards,

Daniel

2022-07-21 14-07-25
Abeer elAssal
 
MVP

Daniël Kuhlmann wrote:

Hi Abeer,

You could follow the next approach:

  • Add dependency to GetRequest_Submit from extension HTTPRequestHandler
  • Add the GetRequest_Submit action to you code, the URL input paramet should be filled with the URL that points to the PDF. The Arguments input parameter can be filled with "", the others are optional.
  • As a result the action returns the PDF document as a Binary in the output parameter BinaryContent. The type of the binary is return in BinaryContentType output parameter
  • You can now store this binary in an OutSystems entity with a parameter of type binary.
  • From there it is available for further usage.

Regards,

Daniel

thanks so much, it works.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Your welcome

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