Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    50

    Unanswered: File System Object Problem Path Not Found

    Hi there i hope some one can shed some light on problem .

    I have writen some code which copys all the file in a selected folder to a destination folder if the file does not already exist in the destination folder
    The code work 100% fine on my laptop in the inetpub\wwwroot folders but when i've put the pages on the web server i just keep getting the error path not found


    I have put a * box around where am getting the error

    please see code below

    My form where you select a file from the folder you want to upload from

    <form action="Add_Report_Submit.asp" enctype="multipart/form-data" method="get">
    <input name="txtPath" type="file" id="txtPath" size="80" />
    <br>
    <input type="submit" name="Submit" value="Submit" />

    </form>


    The Code Below is the code which copys the files
    ************************************
    * Add_Report_Submit.asp *
    ************************************
    <%
    ' Set file system object
    Set fso = Server.CreateObject("Scripting.FileSystemObject")

    'Create recordset Object
    Set newrec = server.CreateObject("ADODB.Recordset")

    newrec.open "tbl_SAS_Documents", objConn,2,3

    ' Path to upload the files to
    uploadFolder = "c:\Inetpub\wwwroot\Transactional_Services\Subsite s\SAS_Reports\Documents\"

    ' Set path with file attached
    Path = Request.QueryString("txtPath")

    ' obtain folder that the file is held in
    objFolder = fso.GetParentFolderName(Path)

    ' Add \ To the path way of folder where files are held
    objFolder = objFolder & "\"
    ***************************************
    ' object holding the folder where files are *
    set fs=fso.GetFolder(objFolder) *
    ***************************************
    ' Uploaded Array size
    intUpLoad = 1

    ' Not Uploaded Array Size
    IntNotUpLoad = 1

    ' for each file in the folder object do the following
    For Each x In fs.Files


    'Get File From Folder To Upload From
    set f=fso.GetFile(objFolder & x.name)

    ' Check To See If File Does Not Exist In The Folder To Upload To Do
    If fso.FileExists (uploadFolder & x.name) = false Then

    ' Change Upload Array Size keeping any information held in there
    ReDim Preserve Upload(intUpLoad)

    ' Add File Name To Array
    Upload (intUpLoad-1) = x.name

    ' Add File Info To Database

    ' Copy File To Upload folder
    f.Copy uploadFolder & x.name , false

    ' Add 1 To Array size
    intUpLoad = intUpLoad +1

    ' If the Files Exists
    ElseIf fso.FileExists (uploadFolder & x.name) = true Then

    'Change the File Not Uploaded array size
    ReDim Preserve notUpload(IntNotUpLoad)

    ' Add The Not Uploaded File Name To Not uploaded array
    notUpload (IntNotUpLoad-1) = x.name

    ' Add 1 Onto the not uploaded array size
    IntNotUpLoad = IntNotUpLoad +1
    End IF

    ' Move onto the next file in the folder object
    Next
    %>


    I hope some one can give some ideas on how to solve this problem or knows how to solve this problem

    Cheers for any help in advance

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    108

    Thumbs up

    Sounds like it could be a permission issue. Check your IUser account, to make sure it has access to all those directories.

    ~Le

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •