<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%Session.CodePage=65001%> <% PicLinkDatabase = request("PicLinkDatabase") PicLinkDataname = request("PicLinkDataname") PicLinkDataID = request("PicLinkDataID") PICs = request("PICs") PicUp = request("PicUp") if PICs="" then PICs=1 else PICs=cint(PICs) end If if PicAlbumsID="" then PicAlbumsID=0 '删除图片 DelID = request("DelID") if DelID<>"" then sql="delete from GBR.dbo.Picture where PicID="&DelID objConn.Execute sql end if '删除图片End %> 图片管理页面 <% 'On Error Resume Next Server.ScriptTimeOut=999999 response.write request("act") if request("act")="upload" Then savepath=Server.MapPath("/"&UploadFilePath) 'savepath=UploadFilePath '创建文件夹 set MyFile=server.CreateObject("Scripting.FileSystemObject") ymd = year(now) & month(now) savepath = savepath & "\" & ymd & "\" filepath = UploadFilePath & "/" & ymd If Not MyFile.FolderExists(savepath) Then MyFile.CreateFolder(savepath) End If CreateFolder(savepath) Set Upload=Server.CreateObject("Persits.Upload") Upload.SetMaxSize UploadLimitSize*1024, True Upload.OverwriteFiles = false if Request.QueryString("PID") = "" then Upload.ProgressID="010D60EB00C5AA4B" else Upload.ProgressID=Request.QueryString("PID") end if Count=Upload.Save(savepath) If Err.Number <> 0 Then Response.Write "
出现错误: " & Err.Number & "、" & Err.Description &"重新上传
" End If If Err.Number = 8 Then Response.Write "
你上传的文件超过限制("& UploadLimitSize/1024 &"M)重新上传
" response.end end If TotalBytesint=UploadLimitSize '上传文件 dim inputname dim size,rs_upfile For Each File in Upload.Files if not CanUpload(File.ext) then File.Delete response.write "
"&file.filename &"("& file.size &") 格式不正确!重新上传
" Else '文件重命名 dim NewName NewName = year(now())&month(now())&day(now())&hour(now())&minute(now())&second(now())&File.ext File.Move savepath & "\" & NewName formPath=savepath&"\" filename=NewName '-------自动压缩图片 720*720 ------- W = cint(720) H = cint(720) Call BuildSmallPic(formPath&filename, formPath&filename, W, H, 80) '-------------end-------------------- '写入数据库 sql="Insert into Picture (PicLinkDatabase,PicLinkDataname,PicLinkDataID,PicAlbumsID,PicUp,PicURL,PicAdminID,PicTotalBytes) values ('"&PicLinkDatabase&"','"&PicLinkDataname&"',"&PicLinkDataID&","&PicAlbumsID&","&PicUp&",'"&filepath&"/"&filename&"','"&session("adminID")&"',"&TotalBytesint&")" 'Response.Write sql 'objConn.Execute sql end if next end if%> <% Set rs = Server.CreateObject("ADODB.Recordset") i=0 If 1=2 then sql="select * from GBR.dbo.Picture WHERE PicLinkDatabase='"&PicLinkDatabase&"' and PicLinkDataname='"&PicLinkDataname&"' and PicLinkDataID="&PicLinkDataID&" order by PicUp" 'rs.open sql,objConn,1,1 if not rs.eof then Response.Write "" do while not rs.eof PicID = rs("PicID") PicURL= rs("PicURL") PicUp = rs("PicUp") i=i+1 if i=5 or i=10 or i=15 or i=20 then Response.Write "" %> <% rs.MoveNext loop rs.close() if i<0 then Response.Write "" End If %> <%if i <%end if%>