LoadImg is JQuery function , you can load and preview picture before upload with ajax , php or any framework .
easy to include in your application , just download or clone from github
$git clone https://github.com/marwenhlaoui/LoadImg.git
add style file loadimg.min.css
in head
<head>
...
<link rel="stylesheet" type="text/css" href="assets/css/loadimg.min.css">
...
</head>
add javascript files loadimg.min.js
and jquery.min.js
...
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/loadimg.min.js"></script>
...
in your form
<label id="upload">
<input type="file">
</label>
in your application js
$('#upload').loadImg({});
$('#upload').loadImg({
"text" : "Upload Picture ...",
});
default text: Upload
$('#upload').loadImg({
"fileExt" : ["png","jpg"],
});
default values : jpg
$('#upload').loadImg({
"fileSize_min" : 0,//0Mo
"fileSize_max" : 1,//1Mo
});
default values : min = 0 Mo and max = 2Mo
If you want to use default picture just add exist-img
attribut in lab
<label id="upload" exist-img="{ Url here }">
<input type="file" name="img">
</label>
This Jquery Projects is open-sourced software licensed under the MIT license.
Made with ♥ by Marwen Hlaoui