Hello everyone, When I upload product picture, I get the error massage: Microsoft VBScript runtime error '800a000d' Type mismatch: '[string: "2/17/200924253"]' /01/admin/Upload.asp, line 49 This error I get when I run it at USA server, but I run it at Chinese server, it's no problem, work well, I don't why. follow is the Upload.asp code: -------------------------------------------------------------------- <!--#include file="conn.asp"--> <!--#include file="inc/upload.inc"--> <script type="text/javascript" src="inc/common.js"></script> <html> <head> <title>Pic upload</title> <style> td{font-size:9pt;line-height:140%} body{font-size:9pt;line-height:140%} a:link { color: #0033CC; text-decoration: none } a:visited { color: #0033CC; text-decoration: none } a:hover { color: #000000; text-decoration: underline} </style> </head> <body topmargin="5" leftmargin="5"> <% dim upload,file,formName,formPath,iCount,uptype,txtname set upload=new upload_5xSoft uptype=upload.form("upid") ExtName = "jpg,gif,swf" if upload.form("filepath")="" then HtmEnd set upload=nothing response.end else formPath=upload.form("filepath") txtname=upload.form("txtname") if right(formPath,1)<>"/" then formPath=formPath&"/" end if iCount=0 for each formName in upload.file set file=upload.file(formName) if file.FileSize>0 then if instr(ExtName,GetExtendName(file.FileName))=0 then Response.write "<script>alert('Wrong file type!');window.close();</script>" Response.End end if dim fname fname = now() fname = replace(fname,"-","") fname = replace(fname," ","") fname = replace(fname,":","") fname = replace(fname,"PM","") fname = replace(fname,"AM","") fname = replace(fname,"AM","") fname = replace(fname,"PM","") fname = int(fname) + int((10-1+1)*Rnd + 1) ------------Line 49 fname=""&fname&"."&GetExtendName(file.FileName)&"" file.SaveAs Server.mappath(formPath&fname) tmp = "http://" & request.servervariables("SERVER_NAME") & _ left(request.servervariables("SCRIPT_NAME"),len(request.servervariables("SCRIPT_NAME"))-len("upload.asp")) picurl=fname picurl = replace(picurl,"..","") end if set file=nothing next set upload=nothing 'Htmend iCount&" sub HtmEnd(Msg) set upload=nothing end sub function GetExtendName(FileName) dim ExtName ExtName = LCase(FileName) ExtName = right(ExtName,3) ExtName = right(ExtName,3-Instr(ExtName,".")) GetExtendName = ExtName end function if picurl<>"" then%> <%if uptype="1" then%> <script>window.opener.document.form1.<%=txtname%>.value='pro/upload/<%=picurl%>';alert('upload ok!');window.close();</script> <%elseif uptype="2" then%> <script>window.opener.document.form1.<%=txtname%>.value='upload/<%=picurl%>';alert('upload ok!');window.close();</script> <%elseif uptype="3" then%> <script>window.opener.document.form1.<%=txtname%>.value='img/upload/<%=picurl%>';alert('upload ok!');window.close();</script> <%end if%> <%else%> select your pic to upload [<a href="Javascript:history.go(-1)">upload again</a>] <%end if%> </body> </html> -------------------------------------------------------------------- Sorry for my poor english, this very urgent! pls give me a help. Thanks.
i'm not sure if this is what your trying to do but add: fname = replace(fname,"/","") Code (markup): before line 49 amongst your other 'replace' lines
I agree with the post above. That's the cause of your problem. And why you have AM and PM replaces twice?