Is there a way for php or ajax to get image size in bytes or kb or mb right away?

bandare

New Member
I have a nice php and ajax script that uploads a photo and displays the image after uploading. I also have rules that it must follow too. But my problem is the maxSize is 2mb, and right now when you choose an image and you start to upload it -- it basically looks at the whole upload (which can take a while) and then it tells you if there is a problem.... Even if the image or picture is 10mb file, it will process this for minutes and minutes and then it will error out and say "File size too big"My question : Is there a way with ajax or php (i know there is with flash) -- to tell right away if the file size is too big?? So, if I have a 8mb picture I want to upload, it will error out right away that the file size is too big, instead of trying to upload and process this... Hope that makes sense!!Thanks
 
Back
Top