I have a script that replaces the content of a container on a webpage. What I would like to do is browse to a file and select it. What I do now is type the info in but would like to automate it more. In asp I can browse to a file from my admin page select the file and it posts the first few lines of the text with a more link. can I do this in javascript?
browse for file in javascript?
Collapse
X
-
are you talking about files on a server or files on your local machine?
for the former, you need a server side language for assistance, for the latter, hm, not through the browser. but tdifferent OS’s have the possibility to write desktop apps in JS. -
On my webserver. It is in my home but I get to it by www. Can't I browse for a file in java script. Maybe something like thisI Know it has thisCode:function openfile(file) { window.location = "file:///" + file;but not sure how to work it.Code:<input type="file">
Maybe I am going at this wrong? I have a script that changes the text in a container on my webpage but I have to navigate to the folder and open the script and type in the text hit a button that changes the text. If I have 6 text areas about 6 things I do it 6 times. I want to do this from 1 page instead of 6.Comment
-
client-side JavaScript cannot do work on the server, period. (think of what would happen if you (resp. anyone else) could)On my webserver.
that is not related to a webserver (they use HTTP), however, check out the FileReader API.Code:function openfile(file) { window.location = "file:///" + file;Comment
Comment