DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: File Copy

  1. #1
    Ted Guest

    File Copy


    I am attemping to copy a file from the IIS 5.0 websever to
    my PC using the following code:

    Set objTextStream = objFSO.GetFile ("C:\Components\flights.xml")
    objTextStream.Copy ("\\tcwynar\public\newflights.xml")

    However, I am getting the following error:

    Microsoft VBScript runtime (0x800A0046)
    Permission denied

    I checked the permissions on my public folder and it is
    set to Full Control for Everyone.

    Does anyone have any ides on how to resolve this issue?

    Thanks,
    Ted



  2. #2
    James Barbetti Guest

    Re: File Copy


    "Ted" <tedcwynar@consolenergy.com> wrote:
    >I am attemping to copy a file from the IIS 5.0 websever to
    >my PC using the following code:
    >Set objTextStream = objFSO.GetFile ("C:\Components\flights.xml")
    >objTextStream.Copy ("\\tcwynar\public\newflights.xml")
    >However, I am getting the following error:
    >Microsoft VBScript runtime (0x800A0046)
    >Permission denied
    >I checked the permissions on my public folder and it is
    >set to Full Control for Everyone.


    >Does anyone have any ides on how to resolve this issue?


    Yep. It's to do with the way IIS integrates with NT security. By default,
    IIS runs
    on a *local* account (usually IUSER_[hostname] where hostName is the
    name of the web server), defined only on the web server, and not
    recognized by other hosts on the network (even ones in the same domain).

    There are basically four ways around the problem.

    (1) run the web site under a different user ID. You can change
    which user by configuring the web application properties from
    the Internet Service Manager.
    You may have security and permssions issues on the web server
    itself, though, if you do this.
    (2) turn on NT challenge/response authentication for the
    directory containing the script (only for intranet sites that use
    IE and not Netscape). Then once the user logs in *their* account
    will be used. This works best if you move the file transfer scripts
    into
    a separate directory.
    Secure, but rather limited.
    (3) this one is dirty, and I'm not sure if it will work.
    Give [webservername]\IUSR_[webservername] (the local account!)
    full control access to the target directory.
    (4) A good way...
    (but I don't know what it might be! Anyone have any suggestions?)

    ...Getting your IIS server to write files on other servers is a real pain,
    huh?
    Hope I've helped some.
    -James



  3. #3
    Colm Guest

    Re: File Copy


    There is an easier (dirtier?) way...

    Map a drive to the UNC path you want to write to.
    Drive mapping takes care of the impersonation required for write permissions.
    Since you're copying to your own machine, I assume you also have control
    of the server...

    --
    Colm
    www.coralquest.com

    "James Barbetti" <james_barbetti@yahoo.com> wrote:
    >
    >"Ted" <tedcwynar@consolenergy.com> wrote:
    >>I am attemping to copy a file from the IIS 5.0 websever to
    >>my PC using the following code:
    >>Set objTextStream = objFSO.GetFile ("C:\Components\flights.xml")
    >>objTextStream.Copy ("\\tcwynar\public\newflights.xml")
    >>However, I am getting the following error:
    >>Microsoft VBScript runtime (0x800A0046)
    >>Permission denied
    >>I checked the permissions on my public folder and it is
    >>set to Full Control for Everyone.

    >
    >>Does anyone have any ides on how to resolve this issue?

    >
    >Yep. It's to do with the way IIS integrates with NT security. By default,
    >IIS runs
    >on a *local* account (usually IUSER_[hostname] where hostName is the
    >name of the web server), defined only on the web server, and not
    >recognized by other hosts on the network (even ones in the same domain).
    >
    >There are basically four ways around the problem.
    >
    >(1) run the web site under a different user ID. You can change
    > which user by configuring the web application properties from
    > the Internet Service Manager.
    > You may have security and permssions issues on the web server
    > itself, though, if you do this.
    >(2) turn on NT challenge/response authentication for the
    > directory containing the script (only for intranet sites that use
    > IE and not Netscape). Then once the user logs in *their* account
    > will be used. This works best if you move the file transfer scripts
    >into
    > a separate directory.
    > Secure, but rather limited.
    >(3) this one is dirty, and I'm not sure if it will work.
    > Give [webservername]\IUSR_[webservername] (the local account!)
    > full control access to the target directory.
    >(4) A good way...
    > (but I don't know what it might be! Anyone have any suggestions?)
    >
    >...Getting your IIS server to write files on other servers is a real pain,
    >huh?
    >Hope I've helped some.
    >-James
    >
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links