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

Turn a Base64 encoded string into a .png image using ASP

Hello everyone,

I am using the FedEx ship manager direct system to get shipping labels.  They send me the .PNG labels encoded in Base64.  How can I convert these Base64 strings into .PNG images that will display in a web browser?

Thank you in advance for your help...
0
greatseats
Asked:
greatseats
  • 3
  • 3
1 Solution
 
kevp75Commented:
is it a string they are sending you, or the actual .png file?

there are a few decrypt/encrypt Base64 classic ASP functions, one in particular comes to mind:http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=6268&lngWId=4

if they are sending you the file, I would imagine you would have to have their certificate installed to be able to open the file.  I'm unsure of your email client so I can't even begin to tell you how to do it....  I would think they would send you the certificate with it, but I don't have a use for using their system
0
 
greatseatsAuthor Commented:
They are sending me the .PNG label encoded in Base64 via XML.  Here is an excerpt of the encoded string:

iVBORw0KGgoAAAANSUhEUgAABXgAAAO2AQAAAAB6QsJkAAAgAElEQVR4nO3dXWzjSJ4Y8OJyIc4Ck+YAeYgM9IkDzCHzEiCec3DXxmpU9wHsIS8770GQU2c2rafkPHA+JKxGRZ0X1i2wGE9u8mDltOJjXgPMQzK43W16BYx2cI4ZYB+CxW26qXXDTJDBND3aG5PXbFb+VaQ+LMmWbIk2fVf/3WlTX9TPMln1rw+WEF1d4BXu66JAK9wXXuG

I can turn the Base64 string into a .PNG file and view it successfully using other programs; I need to know how to do it with ASP code on my web server.

Thanks!
0
 
kevp75Commented:
usually on things that come in your email that is encrypted come with a digital signature or some kind of certificate, if it came directly from FedEx, I am sure they have one that you will need to install.  These certificates usually come signed, and you will need that signature to open it from the email

i don't know what you are talking about by string.  What does the email they send you look like? is this part of a link? is it just some stuff at the bottom of the email, or is there a .png file attached to the email?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
greatseatsAuthor Commented:
They are the sending me the .PNG label encoded in Base64 via XML.  Here is an excerpt from the XML file they send me:

<Labels>
<OutboundLabel>iVBORw0KGgoAAAANSUhEUgAABXgAAAO2AQAAAAB6QsJkAAA.....<OutboundLabel>
</Labels>

Naturally, that is not the entire string.  I shortened it for this post.

I can take the Base64 they send me and easily turn it into a .PNG on my computer.  What I am looking for is a way to convert the Base64 into an image (shippinglabel.png) on my web server using .ASP.

Thanks for all the help so far, I will try to answer questions as best I can.
0
 
greatseatsAuthor Commented:
kevp75, thanks!

The first time I looked at the code in that link you provided it didn't do much for me.  However now it's over a month later and I've learned a lot more.  A little bit of tweaking on my part and I was able to get it to work.  I use the filesystemobject to save it as a png - works great.  Thanks, you're a lifesaver - I'm just slow on the uptake.
0
 
kevp75Commented:
awesome.  Glad to hear it worked out  :)

thanks for the grade
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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