Download URL to the database

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,

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

Solution

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.


Your welcome