File Not Found

Last post 10-19-2010, 12:10 PM by marlon. 1 replies.
Sort Posts: Previous Next
  •  10-19-2010, 9:46 AM 64499

    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
     
  •  10-19-2010, 12:10 PM 64500 in reply to 64499

    Re: File Not Found

    Figured it out.
     
     Replacing Response.end with uploader.WriteValidationOK() - worked.
     
View as RSS news feed in XML