Click to See Complete Forum and Search --> : verifying if a file exists
MadCommando
07-14-2003, 11:25 PM
is there a javascript command that could determine if a file at a certain location exists.
like:
var urllocation="http://www.blahblah.com/file.html"
if(urllocation.location.exists) {document.write(urllocation + " exists")
learninghtml
07-14-2003, 11:41 PM
Originally posted by MadCommando
is there a javascript command that could determine if a file at a certain location exists.
Hi mate,
I think you're on to a loser here mate. As far as I know there is no way to open, read, write, save or modify a file of any format (other than a cookie file of course). I believe this is very delibrate. (Security reasons dude.)
I have asked this very question myself (but not here I might add). I was told (if memory serves) that you can do this using PHP but if your server is not linux then don't bother 'cause PHP is linux only?
I know that when I've submitted this, that someone with a brain the size of Texas will correct me!
Regards
MadCommando
07-15-2003, 12:25 AM
s'alright, it wasn't mandatory to my website, but it would have made it a lot cleaner.
if I were to use a .php how could I check?
learninghtml
07-15-2003, 12:37 AM
Hi,
That's something I can't help you with. I know what I told you because I was thinking about learning and using PHP for something server-side, but my web host don't support it because they're a Windows NT based server. So I've given up on it for the time being. Why not go to the PHP forum they do here. If it's anything like this forum and the HTML it should be good.
Sorry I can't help.
See ya
AdamGundry
07-15-2003, 04:00 AM
PHP is linux onlyNot true - it runs quite happily on my Win 98 machine, and according to the documentation will work on most other versions of Windows as well.
if I were to use a .php how could I check?See this page (http://www.php.net/function.file-exists), in particular example 1.
Adam
learninghtml
07-15-2003, 07:29 AM
Hi,
My apologies, much to my annoyance I was obviously mis-informed.
Thanks for clearing that up.
Regards