sir i want to upload the image that should have only fixed width that is 964px, i don't want to upload the image of any width.
Main Topics
Browse All Topicsi am uploading the image. i want to put restriction on the width before uploading the image. i want that the width of the image must be 964px otherwise javascript error should come to the user.
please help in this.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
There is no way within the browser to know the image width.
The security of the browser does not allow you to pre-check the width.
The only way is via PHP on the server side.
You could look at using Active X, but this will limit browsers. Even then I'm not totally sure if will give you all the information you need.
Javascript does not have permission to access the local file system. What you are asking for can only be check via the server.
Earlier browsers with poorly implemented security might have this feature (security hole) available. The number of people using a browser like this is going to be very small.
You need to upload the file to the server and check the width. Then return the message to the user.
Quote from devarticles:
Scripts are permitted access only to data in the current document or closely related documents (generally those from the same site as the current document). No access is granted to the local file system, the memory space of other running programs, or the operating systems networking layer. Containment of this kind is designed to prevent malfunctioning or malicious scripts from wreaking havoc in the users environment.
It might be worth having a look through the whole article: http://www.devarticles.com
Business Accounts
Answer for Membership
by: ncooPosted on 2009-09-01 at 09:16:30ID: 25233100
Javascript can not access files, it's a security feature within the browser.
n.getimage size
The only way to work out the image width is after it's uploaded using something like: getimagesize() see: http://uk3.php.net/functio
$image = getimagesize('image.jpg');
$width = $image[0];