Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
How to access an unloaded image from javascript using FileAPI there are many articles, including those on Habré
As far as I know, FileAPI does not allow image processing. Thus, you will have to create canvas yourself, add an image to it, process it there, upload it again in text form and send this result to the server.
Together, I did not do this and did not find that someone would describe a similar process and possible difficulties, but individually everything is described a hundred times and I think there will not be any special problems.
Materials:
HTML5 File API
HTML5 CANVAS step by step: images
Difficult, but possible.
The FileAPI allows you to work with raw data.
Any image, before appearing in the browser, must first appear on the server. HTML5 Canvas works great with pictures, but it also doesn't know anything about what picture is on your computer. It needs to be downloaded. The same FileReader in the FileAPI asynchronously loads the file, and does not read its content before downloading.
Alas, the client script is denied access to the local file system.
Even if you have access to the File API in all browsers and still rewrite resize / rotate images for 3 types of images in JS, then it will be terribly stupid on large images.
According to KISS, it's better to send them to the server and change them there.
In addition, even if ie10 declared the absence of a flash, this does not mean that clients will listen to him like that, they will either install a flash or go to another browser.
Take a wait-and-see attitude now, and when you have ~ 3% of users with such a problem, then start discussing who is to blame and what to do
Sending to the server for compression is not an option. A man came from a hike - he has 200 photos of 5 megabytes. sending a gig to the Internet is slow even with today's Internet for a lot of people. Therefore, it is necessary to pinch BEFORE sending.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question