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?
Solved! Go to Solution.
Views
Replies
Total Likes
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,
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.
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();
@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?
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?
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,
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.