主题:我下了chinaasp的上传组件,但不知道怎么用,大哥们进来帮帮我嘛谢谢哈
这是form文件:
<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<script language="JavaScript1.2">
function ChkForm(form1)
{
form1.UploadFileSubmit.disabled = true;
return true;
}
</script>
<form name="form1" method="post" action="UploadFile.asp" enctype="multipart/form-data" onSubmit="return ChkForm(this)">
<td style="font-size:12px" align="center">
<input type="file" name="file" size="16"> <input name="UploadFileSubmit" type="submit" id="UploadFileSubmit" value="ÉÏ´«">
<input type="hidden" name="ReturnFields" value="<%=Request("ReturnFields")%>">
<input type="hidden" name="CopyrightInfo" value="http://www.chinaasp.com">
</td>
</form>
</tr>
</table>
</body>
这里是file上传处理的程序
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim Upload
Dim IssueTime,FilePath,FileName,FormName,File1,FileAimPath
Dim Flag,Aim,AimString
Flag = False
'//得到上传路径
Path = server.MapPath("/")
If Right(path,1) <> "\" Then Path = Path + "\"
Path = Path + "pic\"
'//得到文件名前部名,后部分+ICount
GetNow = Now()
FileName = Cstr(Year(getNow)) + Cstr(Month(getNow)) + Cstr(Day(getNow)) + Cstr(Hour(getNow)) + Cstr(Minute(getNow)) + Cstr(Second(GetNow))
set FileUp=server.createobject("ChinaASP.UpLoad")
dim iCount,ExtName,FileNameTemp,ProductUrl
for each f in fileup.Files
ExtName = getFileExtName(f.fileName)
FileNameTemp = FileName + "." + ExtName
If (f.filesize<>0) and ((ExtName = "jpg") or (ExtName = "gif")) then
f.saveas Path + FileNameTemp
Flag = True
End If
next
Aim = trim(fileup.Form("ReturnFields"))
FileAimPath = "\\pic\\" + Cstr(FileNameTemp)
If Flag Then
Response.Write "<script>"
Response.write "var temp;"
Response.write "eval("&aim&"='"&FileAimPath&"');"
Response.Write "</script>"
End If
''//取得文件扩展名
Function GetExt(FilePath)
Dim S_string
If Len(FilePath) < 1 Then GetExt = ""
S_string = split(FilePath,".")
If Ubound(S_string) < 1 Then
GetExt = ""
Else
GetExt = S_string(Ubound(S_string))
End If
End Function
%>
<script language="JavaScript1.2">
window.close();
//location.href='uploadfileform.asp';
</script>
<%
'//----------
'获得文件的后缀名
function getFileExtName(fileName)
dim pos
pos=instrrev(filename,".")
if pos>0 then
getFileExtName=lcase(mid(fileName,pos+1))
else
getFileExtName=""
end if
end function
%>
朋友给我的,他说安好chinaasp上传组件调用就行,我不懂怎么弄,他又出国了,大哥帮帮我
[em1][em1]