Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
74
rated 0 times [  81] [ 7]  / answers: 1 / hits: 16994  / 13 Years ago, tue, march 29, 2011, 12:00:00

I have an input type=file button. After I choose a file, I have to read the contents of the file using javascript. Is it possible to read/get contents of a chosen file using javascript or ajax?


More From » ajax

 Answers
37

With AJAX its possible to read uploaded file but with pure javascript its not possible because javascript works on client side not on sever side.



if you are going to use jquery than Ajax call may be like this



$.ajax({
url: test.html,
context: document.body,
success: function(){
$(this).addClass(done);
}
});

[#93035] Saturday, March 26, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronaldo

Total Points: 694
Total Questions: 85
Total Answers: 103

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
;