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
photoid=split(flag(0),"=")
bigpic=split(flag(1),"=")
'/****************图片上传*********************/
Set ObjUpload = Server.CreateObject("UploadPhoto.clsUpload")
ObjUpload.sFilterString=".jpg;.bmp;.gif"
lFileLen=ObjUpload.DoUpload(bigpicphy)
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(bigpic(1))"" and fileobject.FileExists(bigpicphy&trim(bigpic(1))) then
InStream=FileObject.DeleteFile (bigpicphy&bigpic(1),1)
end if
set fileobject=nothing
'更新数据库记录
sql="select * from news2_photo where photoId='"&photoid(1)&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,3
if rs.EOF then
Response.Write "erro!"
Response.End
end if
picmenuid=rs("picmenuid")
rs("bigPic")=tempfilename
rs.update
rs.close
Application.UnLock
%>
alert("保存成功!");
Response.Write "继续添加本专辑内的图片"
Response.Write "添加新专辑"%>