What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-20 21:36:04
javascript base64 encode file input
var fileInput = document.getElementById('#myInputID'); var reader = new FileReader(); reader.readAsDataURL(fileInput.files[0]); reader.onload = function () { console.log(reader.result);//base64encoded string }; reader.onerror = function (error) { cons... Add solution -
Javascript 2021-10-12 01:38:08
crop image javascript
Here is a function to get the image as you are uploading using the choose file button function readURL() { const myimg = document.getElementById("myimg"); const input = document.getElementById("myfile"); if(input.files &am... Add solution -
Javascript 2021-10-08 15:34:05
javascript read file from disc
function readSingleFile(e) { var file = e.target.files[0]; if (!file) { return; } var reader = new FileReader(); reader.onload = function(e) { var contents = e.target.result; displayContents(contents); }; reader.readAsText(file);... Add solution -
Javascript 2021-09-25 16:05:04
convert pdf to base64 javascript
// Check for the File API support. if (window.File && window.FileReader && window.FileList && window.Blob) { document.getElementById('files').addEventListener('change', handleFileSelect, false); } else { alert('The File APIs ar... Add solution -
Html 2021-09-21 21:58:02
file upload preview in html
<html> <head> <script type='text/javascript'> function preview_image(event) { var reader = new FileReader(); reader.onload = function() { var output = document.getElementById('output_image'); output.src = reader.result; } reade... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5