Re: Path info for VBscript from HTM page
From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 04/25/04
- Previous message: juavizga: "Re: Path info for VBscript from HTM page"
- In reply to: Ko Vijn: "Path info for VBscript from HTM page"
- Next in thread: Alexander Popkov: "Re: Path info for VBscript from HTM page"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 25 Apr 2004 13:58:27 -0600
"Ko Vijn" <ko@nothere.nnr> wrote in message
news:c6gq1a$tmt$1@news-reader2.wanadoo.fr...
> I would like to run a vbscript from a html page on my website.
> Being new to this game I made something like:
>
> Set fso = CreateObject("Scripting.FileSystemObject")
> set f=fso.opentextfile("mytext.txt", 8, true)
> f.writeLine "this is new text"
> f.close
>
> This script was placed in a html file (under Frontpage), located in folder
> c:\my documents\myweb.
>
> The script runs fine, but the file mytext.txt is placed in the folder
> C:\Documents and Setting/MyName,
> when I run the script under Frontpage, and
> it is put on my Desktop when I run the script from the HTML file.
If you give only a filename, the system has to make some sort of guess as to
where to put it. If you want it in a specific location, specify the exact
path.
> When I
> upload the html file to my website and run the script I get an error.
Likely you do, which of the thousands of possible errors was the one that
you got? If related to security, it is likely because your browser is (very
sensibly) not allowing web pages to modify files on your computer. Don't
change your security settings without understanding what this might mean
should you happen to browse to a site less friendly than your own.
> Neither is what I want, because basically I want to access (for read
and/or
> write) a textfile located in the folder with my html document with the
> script in it, be it local on my PC or on my Website.
Ah, here is the problem, then...
> So, if my_file.html (with a script in it) how do I retrieve its absolute
or
> relative path, when it can sit on my PC or the Website with my provider
IMHO, if you want a web page to modify a file on the web server, then you
should really be looking into server side scripting.
/Al
- Previous message: juavizga: "Re: Path info for VBscript from HTM page"
- In reply to: Ko Vijn: "Path info for VBscript from HTM page"
- Next in thread: Alexander Popkov: "Re: Path info for VBscript from HTM page"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|