Using VBScript with Personal Web Server 
Author Message
 Using VBScript with Personal Web Server

Hi,

I use this script:

<SCRIPT LANGUAGE="VBScript" RUNAT="SERVER">
  Const ForReading = 1, ForWriting = 2, ForAppending = 8
  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.OpenTextFile("testfile.txt", ForWriting, True)
  f.Write "Pokus1"
  f.Close
</SCRIPT>

when I open the page from local directory, it opens the file and writes to
it.
But when I open the page from intranet (I use Personal Web Server) a message
appears: ActiveX can't create object:'CreateObject'.
I tried to set up the access in PWS (read yes, execute yes) and sharing of
the according folder, but it doesn't work.

Thank you

Petr PALAS



Sat, 04 Aug 2001 03:00:00 GMT  
 Using VBScript with Personal Web Server
You're attempting to create an unsafe object -- obviously, we can't let
untrusted web pages create an object that can erase your hard disk.  You'll
have to turn security off if you want to run the FSO on a web page.

Eric


Quote:
> Hi,

> I use this script:

> <SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
>   Const ForReading = 1, ForWriting = 2, ForAppending = 8
>   Dim fso, f
>   Set fso = CreateObject("Scripting.FileSystemObject")
>   Set f = fso.OpenTextFile("testfile.txt", ForWriting, True)
>   f.Write "Pokus1"
>   f.Close
> </SCRIPT>

> when I open the page from local directory, it opens the file and writes to
> it.
> But when I open the page from intranet (I use Personal Web Server) a
message
> appears: ActiveX can't create object:'CreateObject'.
> I tried to set up the access in PWS (read yes, execute yes) and sharing of
> the according folder, but it doesn't work.

> Thank you

> Petr PALAS




Sat, 04 Aug 2001 03:00:00 GMT  
 Using VBScript with Personal Web Server
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile( server.mappath("TESTFILE.TXT"), ForWriting, True)
f.Write "This is only a test..."
f.Close
%>

this saves a file in (on my computer)

D:\InetPub\wwwroot\Testfile.txt



Sun, 05 Aug 2001 03:00:00 GMT  
 Using VBScript with Personal Web Server
But how can I change the security on PWS?


Quote:
>You're attempting to create an unsafe object -- obviously, we can't let
>untrusted web pages create an object that can erase your hard disk.  You'll
>have to turn security off if you want to run the FSO on a web page.

>Eric



>> Hi,

>> I use this script:

>> <SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
>>   Const ForReading = 1, ForWriting = 2, ForAppending = 8
>>   Dim fso, f
>>   Set fso = CreateObject("Scripting.FileSystemObject")
>>   Set f = fso.OpenTextFile("testfile.txt", ForWriting, True)
>>   f.Write "Pokus1"
>>   f.Close
>> </SCRIPT>

>> when I open the page from local directory, it opens the file and writes
to
>> it.
>> But when I open the page from intranet (I use Personal Web Server) a
>message
>> appears: ActiveX can't create object:'CreateObject'.
>> I tried to set up the access in PWS (read yes, execute yes) and sharing
of
>> the according folder, but it doesn't work.

>> Thank you

>> Petr PALAS




Sun, 05 Aug 2001 03:00:00 GMT  
 Using VBScript with Personal Web Server
This looks hopefully but when I use it in this way I get an error "Object
required: 'server' ". I don't know whether I should substitute the string
"server.mappath" with another or so. I'm a begginner so I'm sorry if my
question is funny.

Thanks

Petr PALAS


Quote:
><%
>Const ForReading = 1, ForWriting = 2, ForAppending = 8
>Dim fso, f
>Set fso = CreateObject("Scripting.FileSystemObject")
>Set f = fso.OpenTextFile( server.mappath("TESTFILE.TXT"), ForWriting, True)
>f.Write "This is only a test..."
>f.Close
>%>

>this saves a file in (on my computer)

>D:\InetPub\wwwroot\Testfile.txt



Sun, 05 Aug 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ASP works on Personal Web Server, but not on remote server

2. Server side pages on Personal Web Server

3. Books on using Access Personal Web Server and Visual Basic

4. Books on using Access Personal Web Server and Visual Basic

5. Books on using Access Personal Web Server and Visual Basic

6. Permission Denied on Compile of DLL using Personal Web Server

7. Question: Debugging scripts with MS Visual interDev 6.0 on Personal Web Server

8. Question: Debugging scripts with MS Visual interDev 6.0 on Personal Web Server

9. Global.asa on Personal Web Server

10. Personal Web Server and ASP

11. Question: Debugging scripts with MS Visual interDev 6.0 on Personal Web Server

12. remote scripting and personal web server

 

 
Powered by phpBB® Forum Software