Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
validate image width while upload by file upload control asp.net

help me ..............

thanks in advance
Posted
Comments
Mohibur Rashid 5-Oct-12 7:11am    
Update your question and help us to understand what are you looking for

1 solution

I haven't done this myself so hopefully someone will chip in with a more complete answer.

There is a jquery plugin called uploadify that might help if you want to check on the client side. This[^] is a discussion on Stack Overflow with a problem similar to yours, only they wanted a minimum width. The Javascript is what is useful here, rather than the PHP.

Even if you are validating client side you should validate on the server. In code you can use the Image[^] object to get the width of an image. You can create the Image object via the FromStream method (assuming you can get the stream - I don't know if uploadify will allow this) or by getting the file path of the uploaded file and using the FromFile method. Note that there are restrictions[^] on the types of files Image will support
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900