具体怎么用呢?
这是个图片上传到文件夹的原码
<!--#include FILE="upload.inc"-->
<%
dim fileformat
fileformat=mid(file.FileName,InStrRev(file.FileName, ".")+1)
if fileformat<>"gif" or fileformat<>"jpg" or fileformat<>"png" or fileformat<>"jpeg" or fileformat<>"bmp" or fileformat<>"swf" then
response.write "<Script>alert('您上传的文件是不符合格式的的文件!\n支持上传的文件格式有:*.gif、*.jpg、*.jpeg、*.png、*.bmp、*.swf');history.back()</Script>"
response.end
end if
dim upload,file,formName,formPath,iCount
set upload=new upload_F
function MakedownName()
dim fname
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)
MakedownName=fname
end function
formPath="../file/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
newname=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
file.SaveAs Server.mappath(formPath&newname) ''保存文件
iCount=iCount+1
else
response.write "未找到文件 <A HREF=javascript:history.back(1)>返回</A>"
response.end
end if
next
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<p align="center">文件:</p>
<p align="center">
<%
response.write "<font style=""color:#000000; background-color: #FF0000"">http://"&Request.ServerVariables("SERVER_NAME")&"/file/"&newname&"</font> ("&cint(file.FileSize/1024)&"K) 上传 成功!<br>"
%>
</p>
<p align="center">
请复制红底黑字的文件地址,不要有空格。
</p>
<p align="center">
<a href="upload.asp">继续上传</a>
</p>
<p align="center">
下面是您上传的文件予览
</p>
<p align="center">
<%
if (mid(file.FileName,InStrRev(file.FileName, ".")+1))="swf" then
%>
<EMBED src="../file/<%=newname%>" quality=high WIDTH=300 HEIGHT=280 TYPE='application/x-shockwave-flash'></EMBED>
<%else%>
<img src="../file/<%=newname%>">
<%end if%>
</p>
<%
set file=nothing
set upload=nothing ''删除此对象
%>
</body>
</html>
3个问题
1:为什么我没看见这个页面有接受图片数据的语句
2:它是怎么确定文件进行修改名字的那个文件就是上传的文件
3:fname = int(fname) + int((10-1+1)*Rnd + 1)这句里面的int((10-1+1)*Rnd + 1)为什么写10-1+1