level 1
chanseng1982
楼主
<!--#include file="upload_class.asp"-->
<%
if request.QueryString("act")="upload" then
Dim Upload,path,tempCls,fName
set Upload=new AnUpLoad
Upload.SingleSize=1024*1024*1024
Upload.MaxSize=1024*1024*1024
Upload.Exe="jpg|jpeg|gif|png|zip|rar|7z|pdf|doc"
Upload.Charset="gb2312"
Upload.openProcesser=false
Upload.GetData()
if Upload.ErrorID>0 then
response.write Upload.Description
else
if Upload.files(-1).count>0 then
path=server.mappath("upload")
set tempCls=Upload.files("file1")
tempCls.SaveToFile path,0
fName=tempCls.FileName
set tempCls=nothing
else
response.Write "您没有上传任何文件!"
end if
end if
set Upload=nothing
%>
<script type ="text/javascript">
window.parent.document.form2.photo.value='<%=fName%>';
img="<%=fName%>"
img2="../upload/<%=fName%>"
parent.document.all.form2.photo.value=img
parent.document.all.pic.innerHTML="<img src="+img2+" height=100>"
</script>
<%
else
%>
<form name="upload" method="post" action="uploadpic.asp?act=upload" enctype="multipart/form-data">
<input type ="file" name ="file1" />
<input type ="submit" value="上传" style="height:30px;" />
</form>
<%
end if
%>
2025年01月08日 16点01分
1
<%
if request.QueryString("act")="upload" then
Dim Upload,path,tempCls,fName
set Upload=new AnUpLoad
Upload.SingleSize=1024*1024*1024
Upload.MaxSize=1024*1024*1024
Upload.Exe="jpg|jpeg|gif|png|zip|rar|7z|pdf|doc"
Upload.Charset="gb2312"
Upload.openProcesser=false
Upload.GetData()
if Upload.ErrorID>0 then
response.write Upload.Description
else
if Upload.files(-1).count>0 then
path=server.mappath("upload")
set tempCls=Upload.files("file1")
tempCls.SaveToFile path,0
fName=tempCls.FileName
set tempCls=nothing
else
response.Write "您没有上传任何文件!"
end if
end if
set Upload=nothing
%>
<script type ="text/javascript">
window.parent.document.form2.photo.value='<%=fName%>';
img="<%=fName%>"
img2="../upload/<%=fName%>"
parent.document.all.form2.photo.value=img
parent.document.all.pic.innerHTML="<img src="+img2+" height=100>"
</script>
<%
else
%>
<form name="upload" method="post" action="uploadpic.asp?act=upload" enctype="multipart/form-data">
<input type ="file" name ="file1" />
<input type ="submit" value="上传" style="height:30px;" />
</form>
<%
end if
%>