asp的新闻网站

源代码在线查看: savepic.asp

软件大小: 859 K
上传用户: tanhua1981
关键词: asp 新闻 网站
下载地址: 免注册下载 普通下载 VIP

相关代码

								if Request.TotalBytes >409600 then
					Request.BinaryRead Request.TotalBytes
					Response.Clear 
					Response.Write "您选择的图片超过了400K,上传失败。请重新上传。"
					Response.End 
				end if
				%>
				
				
				
								
				if flag(0)="" or flag(1)="" then
					Response.Write "参数不全,保存数据失败!"
					Response.End 
				end if
					
				commendid=split(flag(0),"=")
				menuid=split(flag(1),"=")
				smallpic=split(flag(2),"=")
				
				'/****************图片上传*********************/
				Set ObjUpload = Server.CreateObject("UploadPhoto.clsUpload") 
				ObjUpload.sFilterString=".jpg;.bmp;.gif"
				lFileLen=ObjUpload.DoUpload(smallpicphy)
				tempFileName=trim(ObjUpload.sFileNewName)
				set ObjUpload=nothing
				
				if lFileLen=0 then
				%>
				
				
					alert("文件上载出错,请重试!");
					window.history.back();  
				
				
								Response.End 
				end if
				Application.Lock 
				'删除旧目标文件
				Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
				if trim(smallpic(1))"" and fileobject.FileExists(smallpicphy&trim(smallpic(1)))  then 
					InStream=FileObject.DeleteFile (smallpicphy&smallpic(1),1)
				end if
				set fileobject=nothing
				'更新数据库记录
				sql="update news2_commend set smallpic='" &tempFileName & "' where commendid='" & commendid(1) & "'"
				conn.execute sql
				Application.UnLock%>
				
				
				alert("保存成功!");
				
								
				
				
							

相关资源