请大家推荐ASP文件上传组件!谢谢!
发布网友
发布时间:2022-04-25 13:41
我来回答
共1个回答
热心网友
时间:2023-10-03 06:52
首先你要有ASPUpload组件
表单:
<form name="form1" method="post" action="001tjsave.asp">
<table width="527" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="43" height="30" align="right"><span class="STYLE2">图片:</span></td>
<td width="168" height="30"><label>
<input name="tp1" type="text" id="tp1">
</label></td>
<td height="30" colspan="2"><iframe name="t" src="upload1.asp" width="100%" height="25" marginheight="0" frameborder="0"></iframe></td>
</tr>
<tr>
<td height="30"> </td>
<td height="30"> </td>
<td width="80" height="30"> </td>
<td width="215" height="30"><label>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</label></td>
</tr>
</table>
</form>
upload1.asp
<form action="uploadsave1.asp" method="post" enctype="multipart/form-data" name="form1" id="form1">
<label>
<input name="tpupload" type="file" id="tpupload" />
</label>
<label>
<input type="submit" name="Submit" value="上传" />
</label>
</form>
uploadsave1.asp
<%set upload=server.CreateObject("persits.upload")
upload.save server.MapPath("upload")
filename=upload.files("tpupload").path
while instr(filename,"\")<>0
filename=mid(filename,instr(filename,"\")+1,len(filename)-instr(filename,"\"))
wend
tp1="<img src=upload\\"&filename&" width=200 height=150 border=0>"
Response.Write "<script>parent.form1.tp1.value+='"&tp1&"' </script>"
Response.Write "<script>history.back()</script>"
%>
以上就可以实现图片上传,但是表单的保存你要放在哪里我就不知道了.