关于上传后赋值给文本问题 紧急
源文件本来是只有一个上传选项 也就是 证件照一 证件照二是我后来添加的UpLoadPick.asp的内容是直接把uploadpic.asp引入
现在每次上传文件后 文件名会赋值给 证件照一的文本框 而用第二个上传 同样也会赋值给 证件照一
我现在想把第二个证件照赋值给第二个文本框 应该如何改 跪求高手 感激不尽
这个是表单数据 在同一个TABLE 的<form action="" method="post" name="Frm" id="Frm" onSubmit="return Search();">这个form表单数据下
<td>证件照一</td>
<td><input name="UserPic" type="text" id="UserPic" value="Upload/empty.jpg" maxlength="100">
<input type="button" name="Submit3" value="上传" onClick="openChild('UpLoadPick.asp',1);"></td>
</tr>
<tr class="TrBody">
<td>证件照二</td>
<td><input name="UserPic2" type="text" id="UserPic2" value="Upload/empty.jpg" maxlength="100">
<input type="button" name="Submit4" value="上传" onClick="openChild('UpLoadPick.asp',1);"></td>
这个是uploadpic.asp
<!--#include FILE="upload.asp"-->
<html>
<HEAD>
<TITLE>上传学生图片</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel=stylesheet type=text/css href=sn.css>
</HEAD>
<BODY bgcolor="menu">
<FORM onSubmit="if(document.forms[0].nlFile.value.length == 0){alert('请选择一张图片再上传');return false;}" action="uploadpic.asp?langtype=cn&a=up" method="post" encType="multipart/form-data">
<table width="100%" border="0" cellspacing="2">
<tr>
<td><input type="hidden" name="MAX_FILE_SIZE" value="31457280">
<INPUT name=nlFile type=file size=32>
</td>
</tr>
<tr>
<td align="right"><INPUT type=submit value=上传 name=sAction>
<INPUT name="button" type=button onClick="javascript: window.close();" value=取消>
<%
if request("a")="up" then
dim upload,file,formName,formPath,iCount
set upload=new upload_5xSoft ''建立上传对象
'--------将日期转化成文件名--------
function MakedownName()
dim fname
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
MakedownName=fname
end function
formPath="upload/" '上传后文件的目录,必须先建好,否则出错
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
IF cint(file.FileSize/1024)>=350 THEN
response.write "上传图片大小不得大于150K,<A HREF='javascript:history.back(1)'>返回</A>"
response.end
end if
newname=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
'----------------------------------------------------------
FileExt="jpg*png*bmp*gif*Gif"
Path=formPath&newname
Ext = LCase(Mid(Path, InStrRev(Path, ".") + 1))
Fileok=split(FileExt,"*")
quok=1
For qu=0 to Ubound(Fileok)
If Ext = Fileok(qu) Then
quok=0
End if
Next
If quok=1 then
response.Write("<script language=javascript>window.alert('上传类型不允许\n请重新上传');</script>")
response.End()
End if
'-------------------------------------------------------------------
m= file.SaveAs (Server.mappath(formPath&newname)) ''保存文件
if m= 1 then
response.Write("<script language=javascript>window.alert('上传过程中出现问题\n请重新上传');</script>")
response.End()
end if
iCount=iCount+1
else
response.write "未找到文件 <A HREF=javascript:history.back(1)>返回</A>"
response.end
end if
next
'------------------------------------------------------
Dim str
response.Write("<script language=javascript>window.alert('上传学生图片成功!');</script>")
str="<script language=javascript>"
Str=str + "returnValue = '" + formPath&newname + "';"
Str=str + "window.close();"
Str=str +"</script>"
Response.Write(str)
'-----------------------------------------------------------
end if
%>
</td>
</tr>
</table>
</FORM>
</BODY>
</HTML>
跪求解决 谢谢各位~