0

I have tried a lot on searching but could not find a working script for the limitation of the file size using javascript here below is my code but it is not working

   if ($('#photo').get(0).files.size >1024 ) 
       {

                 alert("Please select pic size less than  1 mb file .");
                 return false;
    }

Where photo is id of input type file

Rahul
  • 17
  • 4

1 Answers1

0

There was some mistake Which I have forgot thanks for helping me Here is my updated answer

              if ($('#photo').get(0).files[0].size >1048576 ) {
             alert("Please select pic size less than  1mb file .");
             return false;
                }
Rahul
  • 17
  • 4