Marcus Pflanz
Marcus Pflanz

Reputation: 11

Reading local files (images) with Javascript or workaround

I've read it's not possible to read local files using Javascript without letting the user determining those files. Is there a workaround?

Why: We have a tool written in php/js that is running on a webserver to let users process data. This tool has access to very many and big images on the same server (several tera bytes). Users access these images in chunks of about 40 images - if they dealt with one chunk, next one is loaded. Problem is: the traffic issued by these images is so much, users cannot use the tool efficiently at home (loading these images takes too long).

The idea/issue: We wanted to copy the images on a hard drive and let the tool load images from the harddrive instead of the webserver. But unfortunately this seems to be impossible as one may not load local images without letting the user select what to load (which is no option in respect to the amount of files).

Possible Solutions (that came to my mind):

So - any ideas or workarounds for this issue?

Upvotes: 1

Views: 234

Answers (2)

Marcus Pflanz
Marcus Pflanz

Reputation: 11

Solved the issue by using Internet Explorer (9). IE loads local images (which may be a security issue for some but to me it's just a solution). Problems left: The tool is not optimized for IE and thus has lots of CSS and JS issues in IE (but what page which is not opted doesn't have issues with IE? :D)

Thanks for alternative approach anyway :)

Upvotes: 0

Quentin
Quentin

Reputation: 944431

As well as providing the standard web interface, provide a downloadable application that users can use instead. Don't wrap the browser with it, just use an HTTP library to upload the files (which will be easier if you write the web side of things so that it presents a RESTful API as well as a browser application).

Upvotes: 2

Related Questions