6

chrome's access to local files are restricted, but I would like to draw an image on a canvas: an image selected with a file input and without sending the image to the server and then requesting it back.

Some help would be great!

2
  • Is your HTML file also local, or are you asking the user to go to your website, select a file from disk, and then have JavaScript access to that file without ever sending it to your server?
    – Phrogz
    Jan 21, 2011 at 17:45
  • Second answer. The purpose is to make modifications on the image, and upload to the server seems to be time consuming.
    – user494599
    Jan 21, 2011 at 20:11

2 Answers 2

3

Since your using Google Chrome, file:// URIs cannot read other file:// URIs. If you are using this for development, then you can add the following command line switch to chrome:

--allow-file-access-from-files

HTML5 has (currently in development) FileSystem API you can read an example from it here: http://www.html5rocks.com/tutorials/file/filesystem/

0

If your file is not on the local domain, see this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.