Showing posts with label base64. Show all posts
Showing posts with label base64. Show all posts

January 27, 2021

Windows Batch File - Embed Image (Base64 Encoded) in HTML Code

 Hi folks,

Today I am going to explain how we can add an image to the HTML code in without copying the images in relative path folder.

Procedure

  • Prefix file contents.
    • <img src="data:image/png;base64,
  •  Batch file contents.
  • Suffix file contents.
    • " alt="PSR" />
  • Download the batch file.
  • Open command prompt in Windows.
  • Navigate to the batch file contained folder.
  • Execute the batch file image file name as parameter.
    • > Image2Base64ImgTag.bat PSRImage.jpeg
  • You should see a file "imageTag.html".
  • Open the file to see image in a browser.
  • Open the file with notepad to see the image converted to base64 with proper HTML Image tag.


Hope this helps you to reduce lot of efforts in maintaining the image files/folders.

Send your feedback and comments to psrdotcom@gmail.com

October 04, 2020

Base 64 Encode with Powershell Script

 Hi all,

Today I will explain the snippet which gives you a base 64 encoded string

$enc = [system.Text.Encoding]::UTF8

$guid = "42f930c2-2ba2-4d5a-a102-898321122414"

$base64encodedstring = [System.Convert]::ToBase64String($enc.GetBytes($guid))

Write-Host "bBse64 Encoded String: $base64encodedstring"

Hope this helps when you are planning to generate and use/store the base64 encoded value

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com