1
votes

I have a Web Method returning the image in the form of a string.

I have to display it in the Classic ASP user interface by converting it to jpg or jpeg format.

I am able to do the same thing in ASP.NET by calling the Web Service method and converting it to formbase64 format then storing the returning string value in byte[] i.e.

byte[] byteArrayofimage = System.convert.FormBase64String(WebmethodClass.Webmethod(Parameter1,Parameter2));
Response.ContentType ="Image/Jpeg";
Response.BinaryWrite(byteArrayofimage);

but not in Classic ASP... Please help to get these lines in Classic ASP.

1
I believe you will find the answer here.Shadow Wizard Is Vaccinated V3
@ShadowWizard am not able to follow that code could you help me by sort it here with required codes...Padmanaban
I'll see what I can do but can't promise anything. You really better try something on your own, learn how it works, update your post here with your progress and then others would also be able to help.Shadow Wizard Is Vaccinated V3
I accept your point, let me try something and will update here for sure Thank you @ShadowWizardPadmanaban
@ShadowWizard I have used that way only creating one new page and map that page to the image src to display it in a desired place. ThanksPadmanaban

1 Answers

1
votes

You can use base64 string as Data URI to display an image on web page directly, and need not a decode script. for example:

<img src="data:image/jpeg;base64,<%=base64String%>">  <!-- classic ASP -->

<img src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==">