-3
function attachPhoto() {
 var path="http://www.w3schools.com/images/pulpit.jpg";// i need to check size of image
 } 

i have a button while clicking am getting the properties of image(size in kb or mb)

Manuel Allenspach
  • 12,467
  • 14
  • 54
  • 76
user966784
  • 20
  • 1
  • 6
  • possible duplicate of [Determining image file size + dimensions via Javascript?](http://stackoverflow.com/questions/1310378/determining-image-file-size-dimensions-via-javascript) – jeremyharris Aug 07 '12 at 14:29
  • See also http://stackoverflow.com/questions/9253266/how-to-have-jquery-get-image-size-in-bytes-not-image-dimensions – Justin Ethier Aug 07 '12 at 14:31
  • i need to check the image size is how many kilobytes or megabytes? – user966784 Aug 07 '12 at 14:31
  • It's a duplicate of your own question! http://stackoverflow.com/questions/11847629/how-to-check-the-image-file-size-in-jquery – Tchoupi Aug 07 '12 at 14:38

1 Answers1

0

No, you cannot get the image size using jQuery. You will need to process the file using server-side code.

Justin Ethier
  • 131,333
  • 52
  • 229
  • 284