海报边框:文件上传以后怎样记录上传的文件地址的啊?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/14 01:45:27
如:
<td><iframe name="I1" frameborder=0 width="100%" height=30 scrolling=no src="upload.asp"></iframe><input type="text" name="content_up_file" id="content_up_file" size="20" maxlength="80" value="????"></td>

像上面这样我把文件上传以后要样可以使得地址传送到表格输入框的:value值!

其中upload.asp代码为:
<form name="form1" method="post" action="saveupload.asp" enctype="multipart/form-data">
<tr>
<td align="left">
<input type="file" name="file1" size=10 class="an">
<input type="submit" name="Submit" value="上传" class="an"> </td>
</tr>
</form>

saveupload.asp :

<body bgcolor="<%=bgcolor%>" leftmargin="0" topmargin="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<script language="Javascript">
function minipic(smileface)
{
window.opener.document.form.minipic.value=smileface;
}
function pic(smileface)
{
window.opener.document.form.pic.value=smileface;
}
</script>
<%
set upload=new upload_5xSoft
set file=upload.file("file1"
formPath="upload/"
if file.filesize>100 then
fileExt=lcase(right(file.filename,3))
if fileExt="asp" then
Response.Write"文件类型非法"
end if
end if
randomize
ranNum=int(990000*rnd)+910000
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
if file.FileSize>0 then
file.SaveAs Server.mappath(FileName)
end if
response.write "上传成功,[<a href='upload.asp'>返回继续上传</a>]<br>请将路径复制下来粘在下面:<br>路径:"&filename
%>
</td>
</tr>
</table>
我想要的是怎样才能把上传了文件的地址传回给表格value="????">里!
我是新手希望有高手说得具体点.谢谢了

file.filename 就是上传文件的原来文件名。
还有你应该在Response.Write"文件类型非法" 后面加上response.end
不然文件还还是被上传了。

</script>
<%
set upload=new upload_5xSoft
set file=upload.file("file1"
formPath="upload/"
if file.filesize>100 then
fileExt=lcase(right(file.filename,3))
if fileExt="asp" then
Response.Write"文件类型非法"
end if
end if
randomize
ranNum=int(990000*rnd)+910000
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
if file.FileSize>0 then
file.SaveAs Server.mappath(FileName)