Upload Image from Server

Upload Image from Server

  
Hello,

I want to upload image from server i.e. from some URL. How to do it since when we click on upload file control it opens local environemnt?

Thanks and Regards,
Suraj Borade
Hi,

Try using action HttpBinaryGet from extension RichMail to get the image contents.


Hello Paulo Ramos,

I am not able to find HttpBinaryGet from extension RichMail. Can you please provide the location?

Thanks,
Suraj Borade
Hi Suraj,

This extension is installed by default - you should be able to find it using the Add/Remove References button in the top toolbar, from Service Studio.

If you can't find it: maybe the installation was not complete (publishing system components - system_components.osp - is a required step in an on-premises setup), or perhaps you don't have enough permissions to reference this component (on which case you have to request it to your admin).

Hello Paulo Ramos,

Thanks for you help.

I couldn't post my query properly. Suppose if I have stored my image on following location :


https://assets.logitech.com/external/wsrvc/image.cfm?display=83403-S

At run time, I want to attachthat image with my product. How can I do that?
Hi,

I'm not sure what you mean... 
If you need to save the image to your database, then you need to retrieve it (with HttpBinaryGet), and then save the result to an entity (into an attribute of type Binary Data).
Suraj,

What do you mean with "attach that image with my product"? Do you want to use it in a web screen, or send it by mail, or store it in the database, or what?

Hi Paulo,

I did the same way you have explained & it was working fine till now, But now the scenario is as follows: Suppose the URL we are passing is not a valid URL(i.e. image is not present on the server) so in that case it will throw an exception 404 not found & the operation stops there itself.

What I want to achieve is, I want to skip the invalid URL & continue to next URL. Is there any method to check if the URL is valid or not?

Thanks in advance.

Shirish -

1. Wrap the image download in another Action.
2. In that Action, add an ExceptionHandler.
3. Set the ExceptionHandler to "About Transaction" = No.
4. Have that Action return the downloaded data, and an "IsSuccess" boolean.

If any errors are thrown in the download, you will just get nothing back from this action and you can move on to the next record.

J.Ja
Thanks a lot for your reply, I will try this solution.

Thanks again :)
Justin James wrote:
Shirish -

1. Wrap the image download in another Action.
2. In that Action, add an ExceptionHandler.
3. Set the ExceptionHandler to "About Transaction" = No.
4. Have that Action return the downloaded data, and an "IsSuccess" boolean.

If any errors are thrown in the download, you will just get nothing back from this action and you can move on to the next record.

J.Ja
 Hi Justin,

The solution provided by you worked. Thank You :)