<%@Language=VBScript %>
<!-- #include file ="INC/log.asp"-->
<%
dim flag,sFile_Save_Pathif request("upfile")="1" then
uploadrenwu() '执行上传
end ifSub uploadrenwu()                    '上传附件(任务)  sFile_Save_Path=Server.MapPath(uploadFilePath)
  Set obj = Server.CreateObject("LyfUpload.UploadFile")
  Response.Write "<br>"'得到上传文件的数目
num = obj.request("hNum")
if num>6 then
num=6
end iffilename=""
flag="2"
for i=1 to num
  content = obj.request("content"&i) '得到form元素的值
  aa=MakedownName(obj.filetype("file"&i))  '得到文件的Content-Type
  'response.Write(obj.filetype("file"&i))
  'response.End()
  cc=obj.FileSize
  ss=obj.SaveFile("file"&i,sFile_Save_Path,false,aa) '保存文件到服务器'
  
 filename=filename+ss+" "
 
  if ss<> "" and ss<>"3" and aa<>"" then
  sql="insert upload_file (FILE1,KEY_WORD1,CONTENT) values ('"&aa&"','"&ss&"','"& checkStr(content) &"')"
   set rs=server.createobject("adodb.recordset")
   rs.open sql,cn
   flag="1"
   end if
nextif flag="1" then
   response.write "提交成功!请选择其它的操作!<br>"
   Response.Write "选择的文件已经上载到服务器!<br>" 
   Response.Write("文件名:" & filename) 
   response.Redirect("showFile.asp")
  else
   response.write "上传文件为空或上传类型不匹配或上传错误!<br>"
  end ifEnd Sub   %><%
session.CodePage=936
response.Charset="gb2312"set cn=server.createobject("adodb.connection")
connstr= "Provider=SQLOLEDB.1;Persist Security Info=false;User ID=sa;PWD=sa;Initial Catalog=CA_DB;Data Source=HG4537\SQL2000"
cn.open connstr'*****************上传文件路径********************
uploadFilePath="Upload"
'****************过滤非法字符**********************
function checkStr(str)      
if isnull(str) then
checkStr = ""
exit function 
end if
checkStr=replace(str,"'","''")
end function
'--------将日期转化成文件名--------
function MakedownName(filename)
sFile_Type_A="application/x-rar-compressed,image/gif,image/pjpeg,image/bmp,application/x-zip-compressed,application/msword,text/plain,application/vnd.ms-excel,application/pdf,application/octet-stream,application/rtf,application/octet-stream"
sFile_Type_B="rar,gif,jpg,bmp,zip,doc,txt,xls,pdf,tif,rtf,exe"   dim fname,aryType_A,aryType_B,u
   fname = now()
   fname = replace(fname,"-","")
   fname = replace(fname," ","") 
   fname = replace(fname,":","")
   fname = replace(fname,"PM","")
   fname = replace(fname,"AM","")
  fname = replace(fname,"上午","")
   fname = replace(fname,"下午","")
    fname = int(fname) + int((10-1+1)*Rnd + 1)
   aryType_A=split(sFile_Type_A,",")
   aryType_B=split(sFile_Type_B,",")
   for u=0 to ubound(aryType_A)
if instr(filename,aryType_A(u))>0 then
MakedownName=fname & "." & aryType_B(u)
exit for
end if
   next
end function%>这是两个asp文件中的vbscript代码,怎么转为JS呢?(火狐不支持vb)