Hey, I'd like to read a file from the server, by any means necessary. As long as I can use something like JavaScript, like it has to be client sided. No server sided scripting language. If there is no way to read a file from the server, is there a way to read from client's computer?

Thanks, Glut.

Recommended Answers

You can always read a file from a web server; serving files is its nature. But you'll need an URL to tell it which file. Look into XMLHttpRequest().

Accessing the local filesystem from JS generally doesn't work; most browsers flat-out prohibit it even if you load the JS program …

Jump to Post

All 2 Replies

You can always read a file from a web server; serving files is its nature. But you'll need an URL to tell it which file. Look into XMLHttpRequest().

Accessing the local filesystem from JS generally doesn't work; most browsers flat-out prohibit it even if you load the JS program from the local disk. All browsers *should* prohibit accessing anything from outside the 'domain' of the loaded web site.

Solved. Thank you, what you said worked.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.