This works. Place it inside an event listener for when the input changes.
if (typeof FileReader !== "undefined") {
var size = document.getElementById('myfile').files[0].size;
// check file size
}
More Related Contents:
- How to set a value to a file input in HTML?
- How to check file MIME type with javascript before upload?
- Remember and Repopulate File Input [duplicate]
- How to resolve the C:\fakepath?
- Using HTML5 file uploads with AJAX and jQuery
- Does HTML5 allow drag-drop upload of folders or a folder tree?
- jQuery : simulating a click on a doesn’t work in Firefox? [duplicate]
- Reading uploaded text file contents in html
- Get Base64 encode file-data from Input Form
- drag drop files into standard html file input
- How to select multiple files with ?
- get the data of uploaded file in javascript
- Integrating Dropzone.js into existing HTML form with other fields
- Drag-and-drop file uploading without AJAX, synchronously in the foreground?
- What is the best way to upload a folder to a website?
- copying the value of a form’s file input field to another form’s input field
- javascript: upload image file and draw it into a canvas
- how to get full path from fileupload using Javascript
- trigger file upload dialog using javascript/jquery
- Can I use all the HTML tags inside a script tag of type javascript [closed]
- How to change the href attribute for a hyperlink using jQuery
- AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https
- Stopping GIF Animation Programmatically
- How to show popup message like in Stack Overflow
- How can I disable an in a based on its value in JavaScript?
- Making sure at least one checkbox is checked
- Get value from text area [duplicate]
- Resize external website content to fit iFrame width
- how to use html2canvas and jspdf to export to pdf in a proper and simple way
- Split text into pages and present separately (HTML5)