Upload image with preview
How do I make an upload image with preview?
Using javascript to show a preview of the uploaded image.. What is a upload image with preview? How do you make a upload image with preview? This script and codes were developed by Hélio Marcondes on 09 November 2022, Wednesday.
Upload image with preview - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Upload image with preview</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <input id="uploadImage" type="file" name="myPhoto" onchange="PreviewImage();" />
<img id="uploadPreview" style="width: 100px; height: 75px;" />
<script type="text/javascript">
function PreviewImage() { var oFReader = new FileReader(); oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]); oFReader.onload = function (oFREvent) { document.getElementById("uploadPreview").src = oFREvent.target.result; };
};
</script> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Upload image with preview - Script Codes CSS Codes
*{ margin:0; padding:0;
}
#uploadPreview{ border:1px solid red; height:200px; width:200px;
}
#uploadImage{ width:200px; float:left;
}
Upload image with preview - Script Codes JS Codes
var oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("uploadPreview").src = oFREvent.target.result;
};
Developer | Hélio Marcondes |
Username | haykou |
Uploaded | November 09, 2022 |
Rating | 3 |
Size | 2,014 Kb |
Views | 16,192 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Simple Form with Icons | 2,071 Kb |
Custom scrollbar crossbrowser | 5,348 Kb |
Simple search using AngularJS | 1,802 Kb |
Flip CSS Animation with Logo | 1,797 Kb |
Search button expanding input submit | 2,065 Kb |
Simple clock with AngularJS | 1,867 Kb |
Introduction to three.js | 1,916 Kb |
Multi step form | 5,689 Kb |
Speedometer, Velocimeter | 2,256 Kb |
Simple way for icons inside input | 1,847 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Website Concept | Sagoza | 3,104 Kb |
Scroll to top button | DominicFrancois | 3,743 Kb |
Tumblr API | Juanv911 | 2,436 Kb |
Navcube | Wbarlow | 4,775 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 Kb |
Animated skewed panes | NyX | 4,462 Kb |
Boom | Mhrjnsa1 | 1,794 Kb |
Octopus Bar iPad App Interactions | Davidkpiano | 6,735 Kb |
Border image | JohnRiordan | 2,120 Kb |
A Pen by James Podles | Jpod | 2,656 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!