Download image from URL

Download image from URL

  

Hi All

I have an image link from S3 photo server, I want to download the image straight away when I click on the download link. Is there any way to do it? I tried the Download action but not able to pass in the link to it.

After click on the download link, I still want to update the download count in the entity.

Thanks in advance.

Hi Xiao.

Create a page with input parameter that will define which image to download.

Add preparation.

In it, fetch the image, increment the counter of download and finish the preparation with a download node passing to it the image content.

Now, point your link to your new download page.

Cheers

Eduardo Jauch wrote:

Hi Xiao.

Create a page with input parameter that will define which image to download.

Add preparation.

In it, fetch the image, increment the counter of download and finish the preparation with a download node passing to it the image content.

Now, point your link to your new download page.

Cheers

Hi Eduardo

Thanks for the reply. May I know how to fetch the image in preparation? I'm not able to get the image content from the URL.



Hi Xiao,

You can try this component: https://www.outsystems.com/forge/component/3546/amazon-s3/

Or this one: https://www.outsystems.com/forge/component/416/advancedamazons3/

They are interfaces to the API of Amazon S3.
Never used, but they seem very simple...

Cheers.

Solution

Eduardo Jauch wrote:

Hi Xiao.

Create a page with input parameter that will define which image to download.

Add preparation.

In it, fetch the image, increment the counter of download and finish the preparation with a download node passing to it the image content.

Now, point your link to your new download page.

Cheers

Hi Eduardo

I fetch the image by using GetRequest_Submit, this return me the image binary content which I can assign in into the Download node.


Thanks for your guidance!

Regards

Xiao Hui


Solution