关键字:asp 批量上传 asp 图片批量上传 批量上传文件 asp 上传文件 asp文件上传代码 php 文档批量上传
好了,我们现在来看upload.asp文件这个文件的代码主要是一个上传表单了.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>input</title>
</head>
<body>
<form name="form1" method="post" action="up.asp" enctype="multipart/form-data">
文本框:<input type="text" value="abc" name="text1">
<p>文件名:<input type=file name="photo">
</p>
<p>
<input type=submit name="submit" value="提交">
</p>
</form>
</body>
</html>
这上面的就是个基本的html 文件,下面我们再来看up.asp文件.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>up</title>
</head>
<body>
<!--#include FILE="upload_5xsoft.inc"-->
<%
set upload=new upload_5xsoft
set file=upload.file("photo") 'file1为表单字段名
response.write "<br>文件名:"&file.FileName
response.write "<br>文件大小:"&file.FileSize
response.write "<br>文件路径:"&file.FilePath
file.saveAs Server.mappath(file.FileName)
set file=nothing
Response.write "<br>"
Response.write "文本框的内容是:"
Response.write upload.form("text1")
%>
</body>
</html>
up.asp文件调用了upload_5xsof t.inc文件然后用new创建上传文件类实现文件上传,我这里是讲单文件了,多文件只要用for就行了.