Google Answers Logo
View Question
 
Q: read a file on the client-side with Javascript ( No Answer,   2 Comments )
Question  
Subject: read a file on the client-side with Javascript
Category: Computers > Programming
Asked by: arthur78-ga
List Price: $5.00
Posted: 27 Mar 2006 10:37 PST
Expires: 26 Apr 2006 11:37 PDT
Question ID: 712472
I want to write a web application that will read a file chosen by the
user (in a FORM UPLOAD) and process it. One solution is to have
client-side Javascript upload the file to the server, and have the
server echo the file back to the client via an XMLHTTPRequest. But
this is awkward because we have to send the file back and forth over
the network.

Is there any way I can read the file directly from the FORM UPLOAD
object with Javascript? It doesn't seem like a security problem to me,
so I can't figure out why it wouldn't be allowed. I would like this to
work in both IE and Firefox.

Clarification of Question by arthur78-ga on 27 Mar 2006 10:40 PST
By "FORM UPLOAD" I mean <FORM><INPUT TYPE=file></FORM>
Answer  
There is no answer at this time.

Comments  
Subject: Re: read a file on the client-side with Javascript
From: jiangsheng-ga on 29 Mar 2006 11:16 PST
 
Not in IE for security considerations.
see http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q266087
Subject: Re: read a file on the client-side with Javascript
From: define_web-ga on 01 Apr 2006 17:52 PST
 
You need a back end script to be able to download to the file set by
the user in the form input field.

Javascript will get you only so far,

for example PHP is good and easy to use to grab the files uploaded.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy