QUOTE(CodeKing @ Oct 8 2006, 04:56 AM)
When somebody uploads an image, I want a thumbnail of it displayed. I figured I would have javascript read the location of the image, then resize it down to a thumbnail. I only problem is, how do you get the width and height of an image so I can shrink it without distortion. Also, how do you read the value of a file input field?
Javascript has no access to the file system. Until the visitor commits to sending you the file, you can't see it, for obvious security reasons. Before the visitor sends it, it's up to the visitor to arrange whatever mechanism to preview the images to send. (Of course you could write a Doze application to do this and offer it for download if you wish.)
Once the file has been uploaded, it only makes sense to resize it on the server, and show a confirmation page with a thumbnail sized version. You need something like php and the gd library for this.