We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Check if image respect dimension before submitting it

Thread ID:

Created:

Updated:

Platform:

Replies:

123348 Mar 9,2016 10:21 AM UTC Mar 11,2016 03:12 PM UTC ASP.NET Web Forms 1
loading
Tags: Uploadbox
leks
Asked On March 9, 2016 10:21 AM UTC

Hello all,

I want to allow user to upload image with  requirement dimensions (215*115) at minimum. I'm aware that there is the a method ClientSideOnFileSelect. If the file is less than the required , i stop the upload.

Please let me know if you have such scenario. May be i have to use FileReader in that method.

Best regards

Arun Palaniyandi [Syncfusion]
Replied On March 11, 2016 03:12 PM UTC

Hi Leks,

Thanks for contacting Syncfusion support.

Query :” I want to allow user to upload image with  requirement dimensions (215*115) at minimum. I'm aware that there is the a method ClientSideOnFileSelect. If the file is less than the required , i stop the upload.Please let me know if you have such scenario. May be i have to use FileReader in that method.”

 

In Uploadbox, we can restrict the file upload by its dimension using the FileReader in the ClientSideOnFileSelect event as you said. This FileReader function gets the image’s url and through this we can able to get the image dimensions to set the condition to restrict the file upload. If the condition is satisfied an alert message is displayed to show the error and after that the page is reloaded to stop showing the Uploadbox dialog in image onload function. Hence we have prepared a sample by using this FileReader in the ClientSideOnFileSelect event.

 

Please find the sample below:
http://www.syncfusion.com/downloads/support/forum/123348/ze/sample-1027259730
 

Please let us know if you need further assistance.

Regards,
Arun P


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;