• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Display a decodec image on website

I use this code to decode the image:
byte[] todecode_byte = Convert.FromBase64String(img);
Page.Response.BinaryWrite(todecode_byte);

If I do it on the same page I'm on it look's like this:
GIF87ax ¿¿¿¿¿¿  

but if I open it on a other page it display's a picture

How can I make him display on the same page?
0
Mr_Ezi
Asked:
Mr_Ezi
  • 5
  • 3
1 Solution
 
Mr_EziAuthor Commented:
This is how I call it from another page:

<img src="Ups.aspx" alt="UPS Label" "height: 397px; width: 725px"
            style="height: 484px; width: 965px"/>
0
 
tonyenkiducxCommented:
What do you mean by "If I do it on the same page I'm on it look's like this:" ?

Are you trying to stream an image directly into a html page?
0
 
Mr_EziAuthor Commented:
I get a string from ups website and I want to display it on the same page where the code to retrieve this image string is on.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Mr_EziAuthor Commented:
Any help maybe?
0
 
tonyenkiducxCommented:
Mr Ezi,
I'm not sure what you mean by these two seperate scenarios..

"If I do it on the same page I'm on it look's like this:"

"but if I open it on a other page it display's a picture"

Absolutely no offense intended, but your English is a little confusing.  I dont see a different in opening on this page, and opening on another page.  Could you post the exact code used in all your methods, and indicate which one is not working?  If you could post a link for me to look at the broken page that would be great too.

Cheers,
Tony.
0
 
Mr_EziAuthor Commented:
Dear Mr. Tony...
Thanks for trying to help me, and sorry for my English… after all English is not my mother’s language…, but I'll try to explain the problem the best I can, hopefully you'll be able to find a good solution, I already spent a few hours to figure this out but with little success.
OK the story is as follows, I made a web application to get shipping labels from ups, after all the code to get the label, I get from ups the label image decoded in a base64char format, till here it all runs smoothly…
Now the problem is how to decode and display this image for the end user to print it?  
I have one solution but it’s very complicated and that is to send over the decoded image to a new webpage within my application, and then I have to make a 3’rd webpage and in the html of this form I put this code <img src="Ups.aspx" alt="UPS Label"/>  it works, but I know it’s not the right way to do it…
Any idea how to make better?

Thank a lot

Ezi.
0
 
tonyenkiducxCommented:
That's quite alright, and I dont mean to criticise your English, it's very good, just a little hard to understand for me :)

It sounds to me like the ideal situation for you would be to have a ups.aspx, and then you could call the ups.aspx page from your main page.  Can I just check that you have structured your pages as such...

PAGE 1: - SomePage.aspx

<img src="/Ups.aspx?someid=id"/>

PAGE 2: - Ups.aspx
Base64/decode
set content type
binarywrite

If you have, can I see the full code from your ups.aspx page please?
0
 
Mr_EziAuthor Commented:
Sorry I was busy with some other stuff I didn't have time to finish this form.

I could send you the files but its hard to put here, is there a email were I can send it to you directly?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now