Pre-upload Image File Manipulation
Is there any 'hack' that can be applied to do client-side image processing with Javascript and/or CSS/HTML but NO flash? Specifically, is this possible?
(1) First, user selects local file via html file upload mechanism, then (2) javascript accesses local file and runs an algorithm to decrease amount of data uploaded before the form submission is executed.
I think I could do an开发者_运维问答 asynchronous AJAX upload to another server, manipulate the image, return the new URL as (and IMG) to a hidden iFrame, and grab this image before submitting the form. Would this work, or is there a better approach?
The purpose is to radically decrease server load by eliminating the possibility that multi-megapixel images will be uploaded when all the Web app wants is a thumbnail version.
Tanks.
Unfortunatly you will need a plugin for this. Flash, Java applets or any other plugin. But be aware of security issues. Flash just allowed it in the last few versions.
You can upload the image to another server and process it there. And then you can download it from your current server, you don't need to manipulate the URL or use iframes. Store the processed image and return an ID so you can get it later.
精彩评论