Javascript can get file size (size in bytes)?
I need before uploading image, understand what is image size, its possible ?
Javascript can get file size (size in bytes)?
I need before uploading image, understand what is image size, its possible ?
Get a handle to the <input type="file">
element, then:
var file = fileinput.files && fileinput.files[0];
if( file ) {
console.log( file.size, file.type );
}
else if( !("files" in fileInput)) {
// not supported
}
else {
//No file selected
}