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
infoid=split(flag(0),"=")
menuid=split(flag(1),"=")
bigpic=split(flag(2),"=")
'/****************图片上传*********************/
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="update news2_info set bigpic='" &tempFileName & "' where infoid='" & infoid(1) & "'"
conn.execute sql
Application.UnLock%>
alert("保存成功!");