1

i want to restrict the user to upload the fixed height and width image using jquery file upload what i get from the option is

             // Uncomment the following version to restrict the size of
            // uploaded images:
            /*
            '' => array(
                'max_width' => 1920,
                'max_height' => 1200,
                'jpeg_quality' => 95
            ),

I want to check the fixed height and width and i am uploading 2 images and each image has to be in different dimenssion , is there any parameter for that

Uahmed
  • 1,847
  • 5
  • 29
  • 45
  • 1
    You may want to look at the similar problem [here][1] [1]: http://stackoverflow.com/questions/8486414/check-image-dimensions-height-and-width-before-uploading-image-using-php – Minesh May 07 '13 at 10:13

1 Answers1

-1

I would suggest you use PHP rather than any frontend checks in javascript or flash, which can be bypassed.

getimagesize();

Manual: http://php.net/manual/en/function.getimagesize.php

lukeocodes
  • 1,192
  • 1
  • 16
  • 31
  • hi i am searching for jquery-file-upload parameters – Uahmed May 07 '13 at 12:31
  • yes and i would suggest you posted the file and did your checks in your backend software. jquery parameters can be bypassed. – lukeocodes May 08 '13 at 09:56
  • Thanks for the downvote for a valid (albeit 3 year old) answer. I'd suggest that there are still limits to `FileReader` or something similar, having to load the file into an in memory library to be able to validate it, rather than just graceful handle any server side response, in this specifically file upload context. FileReader in Mozilla has a 256MB hard limit and if you exceed it, it will not throw an error (current version). @qwertzman perhaps an suggestion to edit would be more in keeping with the SO community spirit - given the age of the post. – lukeocodes Nov 22 '16 at 10:32
  • My comment is gone for some reason so I presume it was flagged and removed. Your answer is not valid hence the downvote. You also did not mention that this plugin does not support dimension verification. There are other valid methods to do client-side dimension validation. You propose a PHP answer where there is no mention of PHP in the question so yeah, your answer here definitely does deserve a downvote. – qwertzman Nov 22 '16 at 18:48