File Not Found

  •  10-19-2010, 9:46 AM

    File Not Found

    Hi,
     
    I need to code around if the file exists.  The scripts works if file does not exist. It doesn't however work when it exists. Below is the error msg I am getting:

    Microsoft VBScript runtime error '800a0035'

    File not found

    /spsgz/aspuploader/include_aspuploader.asp, line 489

    Below is myhandler.asp -
     
    <%
        Dim uploader, mvcfile, fs, todaysDate

        todaysDate = Year(Now()) & "-" & Month(Now()) & "-" & Day(Now()) & "-" & Hour(Now()) & Minute(Now()) & Second(Now()) & "-"

        sFolderName = sClientFolder & request("_fn")

        Set uploader=new AspUploader
        Set mvcfile=uploader.GetValidatingFile()
        sFileName = mvcfile.FileName
        sTargetfilepath = sFolderName & sFileName

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

        if fs.FileExists(server.mappath(sTargetfilepath)) then
            uploader.WriteValidationError("Duplicate Filename")
            sFileName = todaysDate & mvcfile.FileName
            sTargetfilepath = sFolderName & sFileName
            mvcfile.MoveTo(server.mappath(sTargetfilepath))
            Response.End
        else
            mvcfile.CopyTo(server.mappath(sTargetfilepath))
            uploader.WriteValidationOK()

        end if

        set fs = nothing

    %>
    This is driving me nuts - pls advise.
     
    Thanks
     
View Complete Thread