
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
Client Checking file size using HTML5
Before HTML5, the file size was checked with flash but now flash is avoided in web apps. Still the file size on the client side can be checked by inserting the below given code inside an event listener.
if (typeofFileReader !== "undefined") { // file[0] is file 1 var s = document.getElementById('myfile').files[0].size; }
On file input change, the size will update. For that, use event listener,
document.getElementById('input').onchange = function() { // file[0] is file 1 var s = document.getElementById('input').files[0].size; alert(s); }
- Related Articles
- Using client side XSLT transformations in HTML5
- Validate the size of input=file in HTML5?
- Using HTML5 file uploads with AJAX and jQuery
- Is it possible to validate the size and type of input=file in HTML5?
- Size of file on the Internet using Java
- How to display HTML5 client-side validation error bubbles?
- HTML5 Canvas Font Size Based on Canvas Size
- Checking if a key exists in HTML5 Local Storage
- HTML5 Canvas to PNG File
- JavaScript File Drop with HTML5
- How is a file read using a limited buffer size using Python?
- HTML5 & JavaScript: resolution or size of
- IE supports the HTML5 File API
- What is HTML5 file Blob.slice() method
- C# Program to estimate the size of the file using LINQ

Advertisements