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