Skip to content Skip to sidebar Skip to footer

Upload Image Thumbnail To Server, Without Uploading Whole Image

As far as I know, what I ask here isn't possible, but I thought I'd ask anyway in case I'm missing something. Suppose you want to let users upload JPG images, and these images are

Solution 1:

"If this were possible with Flash, that would seem like the best option."

As I understand it, it is possible with Flash Player 10.

Here's an example:

http://blog.kukiel.net/2009/02/file-manipulation-client-side-with.html

Flash Player 10 currently has a general market penetration of about 85-90%, so if you hesitate to use Java because only 96.52% of your user have it installed, I guess you wouldn't want to require Flash Player 10 either.

Solution 2:

I think if there was a reasonably reliable and user-friendly way to accomplish this, it'd be done on sites like Facebook already. People are used to having to upload the original image... it's always nice to be able to improve on an established UX, but if you can only match it, you're not exactly losing out.

JavaScript is out, because JS cannot read anything directly from the client; it can only direct the browser to load a pre-defined local path, or load bytes from the server.

Flash's security sandbox also prevents this, as you pointed out.

Java has a different set of problems - people rarely install applets these days unless they trust the site more than their own family members. It's also apparently extremely difficult to build something reliable and usable, as evidenced by Facebook-esque companies which have practically unlimited resources to throw at the problem and still fail.

So, in summary - no, and don't worry too much about it.

Solution 3:

If the jpeg image is progressive, you could stop uploading after a certain amount of resolution is acquired. This will require a bit of your own processing of the jpeg loader and http handling code.

It's also a pretty big "IF", since most jpegs are not progressive by default.

Solution 4:

Another way is to use Google's Gears, ex.: Gears Uploader.

Solution 5:

I think that you can upload the image to server, then show it in the browser, then the user will be resize it using javascript, but not real resize, only capture the coordenate of it, then you can use the coordeante to resize the image in the server and save the new image (thumb) and discard the original.

Post a Comment for "Upload Image Thumbnail To Server, Without Uploading Whole Image"