1 file(s) uploaded to c:\upload
恭喜你,成功了!
接下来我们讲讲aspupload的一些属性,并将几个有代表性的例子,其他的大家自己看看附带的例子!
File.Size 单位:bytes
File.Path 路径
File.FileName 文件名字
File.MD5Hash
补充:按例子的解释是check whether this file already exists using MD5 hash ,意思是检查文件是否存在,是个可选项.
File.Path 路径
File.FileName 文件名字
File.MD5Hash
补充:按例子的解释是check whether this file already exists using MD5 hash ,意思是检查文件是否存在,是个可选项.
文字描述与文件的同时上传并显示,例子Form2.asp(自带)和UploadScript2.asp:
UploadScript2.asp代码如下:
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload")
Upload.Save "c:\upload"
%>
Files:<BR>
<%
For Each File in Upload.Files
Response.Write File.Name & "= " & File.Path & " (" & File.Size &" bytes)<BR>"
Next
%>
<P>
Other items:<BR>
<%
For Each Item in Upload.Form
Response.Write Item.Name & "= " & Item.Value & "<BR>"
Next
%>
</BODY>
</HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload")
Upload.Save "c:\upload"
%>
Files:<BR>
<%
For Each File in Upload.Files
Response.Write File.Name & "= " & File.Path & " (" & File.Size &" bytes)<BR>"
Next
%>
<P>
Other items:<BR>
<%
For Each Item in Upload.Form
Response.Write Item.Name & "= " & Item.Value & "<BR>"
Next
%>
</BODY>
</HTML>