Click here to Skip to main content
15,912,457 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi friends,

I have an browse button it is searching for files in the computer and when i clicking ok it is displaying the code of the path but only with fake path.but i want to read the content of the file that i am browsing and the content of the code will be pasted in to some editor.I have used the jquery code to get the path of the file.

Code:
C#
var paths = '';
                        $('input[type=file]').each(function () {
                            paths = paths + $(this).val();
                        });
                        alert(paths);


It is displaying the path of the file with fake path like c:/fakepath/new.docx
after getting the path i want to read the content of the doc file and then i want to paste the code in to the editor can any body help me

I am using jquery and javascript

Thaking you
Posted

1 solution

If you can read full path (c:/fakepath/new.docx) into variable, where is a problem?
Use replace method[^] and replace "/" with "\" ;)
 
Share this answer
 
Comments
Prasad_Kulkarni 23-May-12 0:31am    
My 5!
Maciej Los 23-May-12 2:04am    
Thank you, Prasad ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900