Decoding Base64 Images

2019-01-24 05:19发布

I have recently found a file on the web, and I really need the original url to it, but it's encoded into Base64. It's an image.

The URL Starts with something like this: data:image/png;base64, and then there are loads of numbers and letters.

My question is, how can I decode this to its original form? e.g. instead of mwo1fw# to http://etc

7条回答
SAY GOODBYE
2楼-- · 2019-01-24 05:54

Another way to save the image is just to copy-paste data:image/png;base64, followed by the characters in your browser's url field..
and you'll see the image..
you could then save it to your computer..

查看更多
Explosion°爆炸
3楼-- · 2019-01-24 05:56

How to export the Salesforce Quote PDF file and read convert it from Base64 back to PDF using Linux command Line

  1. Use Dataloader and export the QuoteDocument object with all fields and data

dataloader1

dataloader2

dataloader3   2. Use text editor, TextPad to open the csv file. Don’t use Notepad because it cannot handle the large size data and truncates it. 3. TextPad can handle the large data and respects any newlines characters, etc., when you open the file and also when you copy/paste the data. 4. Go to a specific row in the data and select and copy the cell field string that contains the PDF Base64 encoded data. Make sure you select it all the way to the end – but do not include subsequent fields after it.

textpad1

  1. Do not include subsequent fields after it.
  2. Select the string up to but do not include the quote " symbol.

textpad2

  1. Copy/paste the string into a new TextPad window.
  2. Save the new TextPad to a file, for example, document1.txt
  3. Copy the docuemnt1.txt file to your Linux computer (you could use Dropbox for this).
  4. Open a Linux command line terminal window
  5. Run the base64 decode command (base64 is part of the coreutils package), $ base64 --decode ~/Dropbox/linux_stuff/Document1.txt > ~/Dropbox/linux_stuff/decoded1.pdf
  6. This command will read in the Document1.txt file and output the decoded PDF file to decoded1.pdf.
  7. You can now open the decoded1.pdf file as an PDF file.
  8. You can rename the decoded1.pdf file to whatever you want, i.e., back to the original file name that was attached in the original Salesforce Quote object record.

linux_command_line

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-01-24 05:58

you can decode it here: http://base64decode.net/ and save the response as .png file

查看更多
男人必须洒脱
5楼-- · 2019-01-24 06:04

On Linux machines, there is this base64 utility you can use. Just two steps.

  • Save the base64 encoded text in a file (say image.base64). The base64 encoded text is everything after data:image/png;base64,
  • On a terminal type: base64 -d image.base64 > img.jpg

That's it. img.jpg is your image file. View it by double clicking the file from the file viewer.

查看更多
何必那么认真
6楼-- · 2019-01-24 06:06

Use this web utility:

http://www.motobit.com/util/base64-decoder-encoder.asp

Set the output format to binary, then copy-paste the base64 data that follows data:image/png;base64,; your browser will download the file. Rename it to PNG and you're good to go.

查看更多
Emotional °昔
7楼-- · 2019-01-24 06:07

If you have a Html5 compliant browser and Javascript enabled you can use Base 64 Online

Make sure to remove data:image/png;base64, from your encoded base64 image. Then paste the string into the text input area and click on "Decode > Download" and save the result as .png

查看更多
登录 后发表回答