Downloading an image from dynamic media | Community
Skip to main content
Adobe Champion
February 13, 2023
Solved

Downloading an image from dynamic media

  • February 13, 2023
  • 1 reply
  • 1634 views


If I have a dynamic media image sitting in this url, for eg: 

https://<dynamicmediaurl>/imagename?$test-Web-1005x257$

 

how can I download this image as inputstream programmatically?

does anyone have any sample code?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Saravanan_Dharmaraj

@saravanan_dharmaraj  Could you please help me understand what you mean by package it? Do you mean create a zip? I am good with the zipping part. But i was looking for the scene7 image download part a stream. In your code above image url is scene7 image url which is different from dam image url right?

 


Yes i meant the URL to Dynamic Media image like the one below from our site. The image is delivered from DM server. We are in DM Hybrid,

 

https://siliconlabs-h.assetsadobe.com/is/image//content/dam/siliconlabs/images/community/blog/fg25-ga-launch-mobile.png?$Large2Column50pct$ 

 

Zip Code Examples: https://mkyong.com/java/how-to-compress-files-in-zip-format/

Create the Zip and store in DAM as Asset for later download.

1 reply

Saravanan_Dharmaraj
Community Advisor
Community Advisor
February 14, 2023

You can create URL instance with the path and and create Input Stream. What is your end goal ?

 

URL url = new URL(imageUrl);
InputStream is = url.openStream();

 

P_V_NairAdobe ChampionAuthor
Adobe Champion
February 14, 2023

@saravanan_dharmaraj  Thanks for your comment. My end goal is to create a zip of a set of changed images with a particular dynamic media rendition. 
The image url you mentioned above is dynamic media image url right, which will be different from the dam image url?

P_V_NairAdobe ChampionAuthor
Adobe Champion
February 15, 2023

Yes you can stream and package it. 


@saravanan_dharmaraj  Could you please help me understand what you mean by package it? Do you mean create a zip? I am good with the zipping part. But i was looking for the scene7 image download part a stream. In your code above image url is scene7 image url which is different from dam image url right?