Need help with this script

D

Danny

I am able to read the contents of our dynamic pages, but how can I create
these html files on the fly on our server using asp. THe code below is a
test to see if I can read the html and then save it to a file on our server
in the same directory.

It will not let me write to the file.

I am trying to create static html pages from our dynamic asp script.
I know it is an writes issue, but does anybody have any other ideas?


Thanks

code is below:

----
Set http = CreateObject("microsoft.xmlhttp")
testfile = http://www.myserver.com/index.asp?product=55

http.Open "Post", testfile,False
testit2 = http.Send()
testit = http.responsetext



Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("testfile.html, True)

a.write (testit)
 
R

Ray Costanzo [MVP]

What do you mean, it will not "let" you write? Do you get an error? What
is it? What line?

In your sample code, you're missing a quote:

Set a = fs.CreateTextFile("testfile.htmlHERE, True)

Ray at home
 
D

Danny

Hi Ray

Thanks for writing. Yes, I get a permission error when I run the script. I
guess it is not letting the asp script create the file on the web server?
How can I fix.

THe quotes are in the actual script, thanks for pointing that out.

Thanks
 
R

Ray Costanzo [MVP]

What is the error? (Copy and paste it from your browser.) And what line of
code gives this error?

Ray at work
 
D

Danny

IT is the createtextfile command and this is the error

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/testit.asp, line 81

command is this
Set a = fs.CreateTextFile("testfile.html", True)

Thanks
 
R

Ray Costanzo [MVP]

Try specifying the path in which the file should be created in. By not
specifying a path, it will [attemp to] be created in %systemroot%\system32.
Chances are pretty great that your IUSR doesn't have permissions to write a
file there, not that you'd want it there anyway.

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top