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

1

1 Answer 1

-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

Sign up to request clarification or add additional context in comments.

4 Comments

hi i am searching for jquery-file-upload parameters
yes and i would suggest you posted the file and did your checks in your backend software. jquery parameters can be bypassed.
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.
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.