⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upfile4.asp

📁 软件信息如下: 软件名称:郑州聚鑫打包带厂网站源代码免费版 软件版本:V2008 建议分类:企业网站 联系EMAIL:hzy174@126.com 客服Q Q:908997410
💻 ASP
字号:
<!--#include FILE="../inc/conn.asp"-->
<!--#include file="checkadmin_top.asp" -->
<!--#include FILE="upload.inc"-->
<% id=request("id")%>
<html>
<head>
<title>文件上传</title>
<style type="text/css">
<!--
body {
	font-size: 12px;
	color: #0D498C;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body  bgcolor=#FFFFFF topmargin="0" >
<%
dim upload,file,formName,formPath,iCount,filename,fileExt
set upload=new upload_5xSoft ''建立上传对象


 formPath="pic"
 ''在目录后加(/)
 if right(formPath,1)<>"/" then formPath=formPath&"/" 

iCount=0
for each formName in upload.file ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.filesize<100 then
 	response.write "<font size=2>请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
	response.end
 end if
 	
 if file.filesize>7000000 then
 	response.write "<font size=2>图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
	response.end
 end if

 fileExt=lcase(right(file.filename,4))

 if fileEXT<>".jpg"then
 	response.write "<font size=2>文件格式不对 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
	response.end
 end if 
CommandText="select id,productphoto from productinfo where id="&id&""
set rs=Conn.Execute (CommandText)
if IsNull(rs("productphoto"))=true then
filename=file.filename
else
filename=rs("productphoto")
end if
CommandText="update productinfo set productphoto='"&filename&"' where id="&id&""

 'filename=file.FileName
 savefile=formPath+filename
 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
  file.SaveAs Server.mappath(savefile)   ''保存文件
  
'bannerpath=ulpath& formPath&File.FileName
'bannerpath=filename
Conn.Execute (CommandText)
Response.Write("<script language=""javascript"">alert('图片更新成功!');location='upproductinfo.asp?id="&id&"';</script>")
Response.End()
 end if
 set file=nothing
 iCount=iCount+1
next
set upload=nothing  ''删除此对象

%>
</body>
</html>
<!--#include file="checkadmin_bottom.asp" -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -