Click here to Skip to main content
15,886,707 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am having list of Base64 strings I want to print all the base 64 strings as per its type. Base64 can be of any type like pdf, jpg, jpeg. Is there a way that we can do this?

What I have tried:

I tried many solutions on the but not finding any.
Posted
Updated 11-Feb-22 23:27pm

1 solution

No, because even if you translate the Base64 data back to binary (even partially) not all files contain any "markers" that identify it as a particular type of data - that's the job of the filename extension, and though some file formats do include a header which identifies them to a reader of that file type as "correct info" most do not.

Look at the originating software to see what it does with the file extension - if it prefixes it into the Base64 string you are laughing. If it doesn't ... you probably have no way to identify file type from content reliably.
 
Share this answer
 
Comments
MukulMohal 13-Feb-22 12:08pm    
Thanks orignalGriff for the quick reply
I have file format which I need to print. I tried to create file from the base64 string and then print it, I was able to create file. but print I got was only one. but when there were multiple files I am not sure how to make it work. I am trying for that. Just for that I am looking if I can directly print from base64 or not ...
Any help is really Important

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900