Skip to content

bachors/Base64-Image-Encoder-Ajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tools Base64 Image Encoder ini digunakan untuk merubah gambar kedalam bentuk base64 yang bertujuan untuk mengurangi permintaan http atau server lain ketika membuka sebuah halaman website atau blog.

Keterangan:

1. jquery.min

2. jquery.form

3. Proses upload & menampilkan menggunakan Ajax

Brikut contoh proses merubah image menjadi Base64 menggunakan PHP:

<?php
   $path = 'image.jpg';
   $type = pathinfo($path, PATHINFO_EXTENSION);
   $data = file_get_contents($path);
   $base64 = '<img src="data:image/' . $type . ';base64,' . base64_encode($data).'"/>';
   echo $base64;     
?>

DEMO

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published