Changing filename using AJAX uploader

  •  03-10-2011, 10:37 PM

    Changing filename using AJAX uploader

    I am using the following code in my ajax handler:
     
    <%@ Language="VBScript" %>
    <!-- #include file="aspuploader/include_aspuploader.asp" -->
    <%

    Dim uploader,mvcfile
    Set uploader=new AspUploader
    Set mvcfile=uploader.GetValidatingFile()    
            
        targetfilepath= "savefiles/myprefix_" & mvcfile.FileName    
            
        dim fs    
        Set fs=Server.CreateObject("Scripting.FileSystemObject")    
        if fs.FileExists(server.mappath(targetfilepath)) then    
          fs.DeleteFile(server.mappath(targetfilepath))    
        end if    
        set fs=nothing    
            
        mvcfile.MoveTo( server.mappath(targetfilepath))    
       
        uploader.WriteValidationOK()

    If Request.Form("guidlist")&""<>"" Then
        Dim list,i
        list=Split(Request.Form("guidlist"),"/")
        Response.Write("[")
        For i=0 to Ubound(list)
            if i>0 then
                Response.Write(",")
            end if
            Set mvcfile=uploader.GetUploadedFile(list(i))
            Response.Write("{")
            Response.Write("FileGuid:'" & mvcfile.FileGuid & "'")
            Response.Write(",")
            Response.Write("FileSize:'" & mvcfile.FileSize & "'")
            Response.Write(",")
            Response.Write("FileName:'" & mvcfile.FileName & "'")
            Response.Write("}")
        Next
        Response.Write("]")
    End If


    Response.End()

    %>


    However I am getting the following error:

    Microsoft JScript runtime error '800a139e'

    Call PreProcessRequest before access this member! at function Ox29

    /aspuploader/resources/coreimpl.js, line 1


    Any suggestions?
















     
     
     
     
     
View Complete Thread