image width check
Hi Ray
Is there a way to user the server validations to check and make sure that an image file is at least a certain width or would it need to be done with js?
Cheers
Hi Ray
Is there a way to user the server validations to check and make sure that an image file is at least a certain width or would it need to be done with js?
Cheers
You can do it. The file upload server behavior will have the width and height available for image uploads. You can use that with number validation to add restrictions. You just have to manually move the upload code above the validation code.
OK
$WAFV_Errors .= WAValidateNM(WADFP_getImageWidth((isset($_FILES["ProductThumbnail"]))?$_FILES["ProductThumbnail"]:"") . "",1900,3000,"",",.",true,5);
Keeps failing validation with an image of 1920px width - when I comment out this validation, the image uploads without any problem at all
Can I get a url to reproduce and FTP access? I'll debug and see what is going on.
I see... since you are validating the $_FILES["ProductThumbnail"] value directly, you didn't need to move the file upload code above the validation. In fact, that deletes the temp file and caused the validation to fail.
I moved the file upload code back down below the validation and that seems to have resolved this issue.
Sorry but it wont allow a blank entry for some reason
$WAFV_Errors .= WAValidateNM(WADFP_getImageWidth((isset($_FILES["ProductThumbnail"]))?$_FILES["ProductThumbnail"]:"") . "",2000,"","",",.",false,5);
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.