Get filesize of file without uploading


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function checkFileSize() {
  2. if (typeof FileReader !== "undefined") {
  3. var size = document.getElementById('myfile').files[0].size;
  4. //do something with size
  5. }
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.