Need help Object required: 'jfile'

Last post 02-04-2011, 4:29 PM by gnuzim. 2 replies.
Sort Posts: Previous Next
  •  02-04-2011, 4:52 AM 66046

    Need help Object required: 'jfile'

    Hi again =)
     
    Object required: 'jfile' 
    /include_aspuploader.asp, line 464
     
    Well, i read some previous posts about this error and i tried the handdle page. I don't know if that would make any difference.
     
    The script is working,  even with multiple files, but sometimes this error appears, most of the times when i send more than 10 files with at least 5mb each
     
    If i send 10 files with 200kb this error don't appear!
    Can someone help me, once again =/ 
     
    Thanks 
  •  02-04-2011, 9:39 AM 66051 in reply to 66046

    Re: Need help Object required: 'jfile'

    Dear gnuzim,
     
    When did you download and install ASP Uploader on your end? Are you using latest version?
    Please post your runnable code here, I will test your code on my end.
     
    Thank you for asking
  •  02-04-2011, 4:29 PM 66073 in reply to 66051

    Re: Need help Object required: 'jfile'

    I tried the new version already.  I hope im not  missing nothing!
    Thanks 
     
    ajax-multiplefiles-handler2.asp
    1. <!-- #include file="include_aspuploader.asp" -->  
    2.    
    3. <%  
    4. Dim uploader,mvcfile  
    5. Set uploader=new AspUploader  
    6.   
    7. Set fso=CreateObject("Scripting.FileSystemObject")  
    8. savefolder=Server.MapPath("upld")  
    9.   
    10. If Request.Form("guidlist")&""<>"" Then  
    11.     Dim list,i  
    12.     list=Split(Request.Form("guidlist"),"/")  
    13.     Response.Write("[")  
    14.     For i=0 to Ubound(list)  
    15.       
    16.         if i>0 then  
    17.             Response.Write(",")  
    18.         end if  
    19.           
    20.         Set mvcfile=uploader.GetUploadedFile(list(i))  
    21.         if fso.FileExists(savefolder&"\"& day(date())&month(date())&hour(time())&replace(tratarChr2(mvcfile.FileName)," ","_"))<>true then  
    22.           
    23.             fso.MoveFile mvcfile.FilePath,savefolder & "\" & day(date())&month(date())&hour(time())&replace(tratarChr2(mvcfile.FileName)," ","_")  
    24.   
    25.         if(titulo = "") then  
    26.             x = split(replace(replace(mvcfile.FileName,"_"," "),"'",""),".")  
    27.             for v = 0 to ubound(x)  
    28.                 ar = ar + 1  
    29.             next  
    30.             if(ar > 0) then  
    31.                 titulo = replace(mvcfile.FileName,"_"," ")  
    32.             else  
    33.                 titulo = x(0)  
    34.             end if  
    35.         end if  
    36.   
    37.           
    38.         cat = ucase(right(mvcfile.FileName,3))  
    39.         SELECT CASE cat  
    40.             CASE "JPEG""JPG""GIF""PNG"  
    41.                 cat = "Imagem"  
    42.             CASE "ZIP","RAR"  
    43.                 cat = "Compactado"  
    44.             CASE "DOC","PDF","DOCX","TXT","RTF"  
    45.                 cat = "Documento"  
    46.             CASE "EXE"  
    47.                 cat = "Aplicativo"  
    48.             CASE "MP3","WAV"  
    49.                 cat = "Música"  
    50.             CASE "AVI","MPEG","MPG","MP4","WMV","RM","RMVB","MKV","MOV","ASF","FLV"  
    51.                 cat = "Vídeo"  
    52.         end select  
    53.           
    54.         sql = "INSERT INTO files(uid,titulo,file,rate,size,cat,show,data,hr,ip)VALUES("&Session("id")&",'"&replace(titulo,"'","")&"','"&day(date())&month(date())&hour(time())&replace(tratarChr2(mvcfile.FileName)," ","_")&"',0,'"&formatNumber(mvcfile.FileSize/1000/1000,2)&"','"&cat&"',1,'"&date()&"','"&time()&"','"&Request.ServerVariables("REMOTE_ADDR")&"')"  
    55.         conexao.execute(sql)  
    56.         end if  
    57.         Response.Write("{")  
    58.         Response.Write("FileGuid:'ee'")  
    59.         Response.Write(",")  
    60.         Response.Write("FileSize:'aa'")  
    61.         Response.Write(",")  
    62.         Response.Write("FileName:'"&mvcfile.FileName&"'")  
    63.         Response.Write("}")  
    64.           
    65.     Next  
    66.     Response.Write("]")  
    67. End If  
    68.   
    69. Response.End()  
    70. %>   
     
     
    compartilhar.asp
    1. <!-- #include file="include_aspuploader.asp" -->  
    2.     <script type="text/javascript">  
    3.         var handlerurl='ajax-multiplefiles-handler2.asp'  
    4.     </script>  
    5.     <script type="text/javascript">  
    6.     function CuteWebUI_AjaxUploader_OnPostback()  
    7.     {  
    8.         var uploader = document.getElementById("myuploader");  
    9.         var guidlist = uploader.value;  
    10.   
    11.         //Send Request  
    12.         var xh;  
    13.         if (window.XMLHttpRequest)  
    14.             xh = new window.XMLHttpRequest();  
    15.         else  
    16.             xh = new ActiveXObject("Microsoft.XMLHTTP");  
    17.           
    18.         xh.open("POST", handlerurl, false, null, null);  
    19.         xh.setRequestHeader("Content-Type""application/x-www-form-urlencoded; charset=utf-8");  
    20.         xh.send("guidlist=" + guidlist);  
    21.   
    22.         //call uploader to clear the client state  
    23.         uploader.reset();  
    24.   
    25.         if (xh.status != 200)  
    26.         {  
    27.             alert("http error " + xh.status);  
    28.             setTimeout(function() { document.write(xh.responseText); }, 10);  
    29.             return;  
    30.         }  
    31.   
    32.         var filelist = document.getElementById("filelist");  
    33.   
    34.         var list = eval(xh.responseText); //get JSON objects  
    35.         //Process Result:  
    36.         for (var i = 0; i < list.length; i++)  
    37.         {  
    38.             var item = list[i];  
    39.             var msg = "Enviado: " + list[i].FileName;  
    40.             var li = document.createElement("li");  
    41.             li.innerHTML = msg;  
    42.             filelist.appendChild(li);  
    43.         }  
    44.     }  
    45.     </script>  
    46.    
    47. <form id="form1" method="POST" onSubmit="return false" style="<%=disp%>">  
    48. <%  
    49.             Dim uploader  
    50.             Set uploader=new AspUploader  
    51.             uploader.MaxSizeKB=2014000  
    52.             uploader.Name="myuploader"  
    53.             uploader.MultipleFilesUpload=true  
    54.             uploader.InsertText="Selecione o(s) arquivo(s)"  
    55.             uploader.AllowedFileExtensions="jpeg,jpg,gif,png,zip,doc,exe,pdf,rar,mp3,wave"  
    56. %>  
    57.             <table align="  
    58.                 <td colspan="2" align="center">  
    59.                 <%=uploader.Render()%><br/>  
    60.                 <div id="filelist"></div>  
    61.                 </td>  
    62.                                 </table>  
    63.                   
    64.   
    65. </form>  
     
View as RSS news feed in XML