Client side script can't use fso from IIS 
Author Message
 Client side script can't use fso from IIS

This one is making me crazy.
I've created an html page with a VBScript similar to this:

<script language="vbscript">
<!--
Sub MakeFile
    Dim fso, myFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set myFile = fso.CreateTextFile("c:\Time.rtf", True)
    myFile.WriteLine "test1"
    myFile.WriteLine "test2"
    myFile.Close
End Sub
-->
</script>

and in the body of the page there is an input of type "button" which calls
the sub in its onclick event.
This script works fine if I simply open the page in a browser and click the
button.  However, if I put the page into my wwwroot folder and open it via
IIS, I get this error when I try to run the script:
Error: ActiveX component can't create object: 'Scripting.FileSystemObject'
The error refers to the line "Set fso =
CreateObject("Scripting.FileSystemObject")".
I haven't found any relevant help from the knowledge base or in searching
the web.
Anyone have an idea?

TIA,
Craig G



Sat, 17 Jul 2004 05:15:54 GMT  
 Client side script can't use fso from IIS
that happened to me too. it took days for me to relize
that the fso will never run on the client only localy.
its a permisions thing. would you want to brows to a page
on the net and have it have a script use the fso to delet
your hard drive? it may work though if the settings in ie
are set to the lowest permitable. otherwise use an ocx or
applet

Quote:
>-----Original Message-----
>This one is making me crazy.
>I've created an html page with a vbscript similar to
this:

><script language="vbscript">
><!--
>Sub MakeFile
>    Dim fso, myFile
>    Set fso = CreateObject("Scripting.FileSystemObject")
>    Set myFile = fso.CreateTextFile("c:\Time.rtf", True)
>    myFile.WriteLine "test1"
>    myFile.WriteLine "test2"
>    myFile.Close
>End Sub
>-->
></script>

>and in the body of the page there is an input of

type "button" which calls
Quote:
>the sub in its onclick event.
>This script works fine if I simply open the page in a

browser and click the
Quote:
>button.  However, if I put the page into my wwwroot

folder and open it via
Quote:
>IIS, I get this error when I try to run the script:
>Error: ActiveX component can't create

object: 'Scripting.FileSystemObject'
Quote:
>The error refers to the line "Set fso =
>CreateObject("Scripting.FileSystemObject")".
>I haven't found any relevant help from the knowledge

base or in searching

- Show quoted text -

Quote:
>the web.
>Anyone have an idea?

>TIA,
>Craig G

>.



Sat, 17 Jul 2004 06:22:37 GMT  
 Client side script can't use fso from IIS
I doubt you actually mean to but if your really trying to use FSO in client
side script then you might want to think about converting the page to an HTA
document or compiling it to an activeX component.  This would be a major
security flaw if you were able to access the files on my pc from your
website would'nt it?

Bryan Martin


Quote:
> This one is making me crazy.
> I've created an html page with a vbscript similar to this:

> <script language="vbscript">
> <!--
> Sub MakeFile
>     Dim fso, myFile
>     Set fso = CreateObject("Scripting.FileSystemObject")
>     Set myFile = fso.CreateTextFile("c:\Time.rtf", True)
>     myFile.WriteLine "test1"
>     myFile.WriteLine "test2"
>     myFile.Close
> End Sub
> -->
> </script>

> and in the body of the page there is an input of type "button" which calls
> the sub in its onclick event.
> This script works fine if I simply open the page in a browser and click
the
> button.  However, if I put the page into my wwwroot folder and open it via
> IIS, I get this error when I try to run the script:
> Error: ActiveX component can't create object: 'Scripting.FileSystemObject'
> The error refers to the line "Set fso =
> CreateObject("Scripting.FileSystemObject")".
> I haven't found any relevant help from the knowledge base or in searching
> the web.
> Anyone have an idea?

> TIA,
> Craig G



Sat, 17 Jul 2004 06:39:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using DLL's from VBS (all client side)

2. Using DLL's from VBS (all client side)

3. Using DLL's from VBS (all client side)

4. Client side scripting / server side scripting

5. Accessing Data generated with client-side script from server-side script

6. Calling Server Side Script from Client Side Script

7. Call Server Side Script From Client Side Script

8. Client side scripting / server side scripting

9. Server Req's for Client-Side Scripting

10. Getting Client's IP Address on Client Side

11. Obtaining Client's Computername with Client-side Jscript

12. FSO in ASP won't recurse folder on IIS

 

 
Powered by phpBB® Forum Software