FileSystemObject question

Discussion in 'ASP General' started by Mo Bandy, Sep 19, 2007.

  1. Mo Bandy

    Mo Bandy Guest

    Using FSO I want to copy a file from the web server to a mapped network
    drive (Novell server) using a physical path. However I keep getting an error
    (path not found). Can someone help please...thanks. Code summary below.

    'get the Physical Path of file
    MyFile = Server.MapPath("..\..\..\fileshare\FILENAME.INI")

    Set FSO = Server.CreateObject("Scripting.FileSystemObject")

    'copy file to novell server
    dim CopyDest
    CopyDest = "f:\temp\" (also tried using:) CopyDest =
    "\\servername\temp\"

    fso.CopyFile MyFile,CopyDest


    What am I missing? It's gotta be something simple.
    Mo Bandy, Sep 19, 2007
    #1
    1. Advertising

  2. Mo Bandy

    Mo Bandy Guest

    I did that and it looked correct. So the code I used should work providing
    the physical path returned is valid...yeah?

    "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in message
    news:...
    > use a response.write to verify physical path names .
    >
    >
    > "Mo Bandy" <> wrote in message
    > news:eXRONDu%...
    >> Using FSO I want to copy a file from the web server to a mapped network
    >> drive (Novell server) using a physical path. However I keep getting an
    >> error (path not found). Can someone help please...thanks. Code summary
    >> below.
    >>
    >> 'get the Physical Path of file
    >> MyFile = Server.MapPath("..\..\..\fileshare\FILENAME.INI")
    >>
    >> Set FSO = Server.CreateObject("Scripting.FileSystemObject")
    >>
    >> 'copy file to novell server
    >> dim CopyDest
    >> CopyDest = "f:\temp\" (also tried using:) CopyDest =
    >> "\\servername\temp\"
    >>
    >> fso.CopyFile MyFile,CopyDest
    >>
    >>
    >> What am I missing? It's gotta be something simple.
    >>

    >
    >
    Mo Bandy, Sep 19, 2007
    #2
    1. Advertising

  3. "Mo Bandy" wrote:
    > ...Using FSO I want to copy a file from the web server to a mapped
    > network drive (Novell server) using a physical path...
    >
    > ...Set FSO = Server.CreateObject("Scripting.FileSystemObject")


    Server.CreateObject suggests this is running as an ASP script. In that case,
    the account IIS is running under must have the necessary privileges to
    connect to that share. Mapping the drive in your Windows session is
    insufficient, as it is a USER mapping.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
    Dave Anderson, Sep 19, 2007
    #3
  4. I wrote:
    > ...the account IIS is running under must have the necessary
    > privileges to connect to that share...


    I should have also said that this article has some possible solutions:
    http://www.aspfaq.com/show.asp?id=2168



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
    Dave Anderson, Sep 19, 2007
    #4
  5. Mo Bandy

    Mo Bandy Guest

    I will try...thanks for your help and validation.

    "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in message
    news:...
    > if the path names are truly valid, yes.
    >
    > test by trying to open the resulting path in another application
    >
    >
    > "Mo Bandy" <> wrote in message
    > news:%23B6dqlu%...
    >>I did that and it looked correct. So the code I used should work providing
    >>the physical path returned is valid...yeah?
    >>
    >> "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in message
    >> news:...
    >>> use a response.write to verify physical path names .
    >>>
    >>>
    >>> "Mo Bandy" <> wrote in message
    >>> news:eXRONDu%...
    >>>> Using FSO I want to copy a file from the web server to a mapped network
    >>>> drive (Novell server) using a physical path. However I keep getting an
    >>>> error (path not found). Can someone help please...thanks. Code summary
    >>>> below.
    >>>>
    >>>> 'get the Physical Path of file
    >>>> MyFile = Server.MapPath("..\..\..\fileshare\FILENAME.INI")
    >>>>
    >>>> Set FSO = Server.CreateObject("Scripting.FileSystemObject")
    >>>>
    >>>> 'copy file to novell server
    >>>> dim CopyDest
    >>>> CopyDest = "f:\temp\" (also tried using:) CopyDest =
    >>>> "\\servername\temp\"
    >>>>
    >>>> fso.CopyFile MyFile,CopyDest
    >>>>
    >>>>
    >>>> What am I missing? It's gotta be something simple.
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Mo Bandy, Sep 19, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pedro Bautista
    Replies:
    0
    Views:
    521
    Pedro Bautista
    Aug 29, 2003
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    FileSystemObject Question

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 22, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,692
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Nov 22, 2004
  3. =?Utf-8?B?a2VybWl0?=

    Script w/ FileSystemObject, error creating object

    =?Utf-8?B?a2VybWl0?=, Apr 22, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    5,165
    =?Utf-8?B?a2VybWl0?=
    Apr 24, 2005
  4. Steve

    FileSystemObject question...

    Steve, Jan 15, 2004, in forum: ASP General
    Replies:
    3
    Views:
    186
    Aaron Bertrand - MVP
    Jan 15, 2004
  5. The Frog
    Replies:
    3
    Views:
    210
    The Frog
    Aug 2, 2004
Loading...

Share This Page