氢气和碘单质反应:怎样可以实现点击一个按钮就可以弹出一个指定的asp窗口实现文件上传?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 05:46:11
如:
我想在 1.asp 中点击一个按钮,就会弹出upload.asp小窗口。
在upload.asp中上传了文件,(其中upload.asp是用来将上传文件传送到saveupload.asp中实现上传的)
最后在saveupload.asp中实现了上传后我希望能将上传得到的文件保存路径传送回1.asp页面中。

其中各页面代码如下:
upload.asp:
<body bgcolor="#ffffcc" leftmargin="0" topmargin="0">
<table width="580" height="3" border="0" cellpadding="0" cellspacing="0">
<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>
</body>

/////////////////////////还需要的其它文件就不写出了。希望有人可以帮我解答。谢谢

弹出窗口不是问题,我想你应该是问如何返回值到输入框或hidden框吧!
可以用
window.opener.document.form1.text.value=""
来实现

window.open("upload.asp",_blank);

window.opener.document.form1.text.value=""
就是这句话

<%
response.write "<script language='JavaScript'>parent.document.forms[0].images.value='upfile/"& newname &"'</script>"
%>