<% 'Write this form to db on error resume next path = "photocap/" & year(nowcalibrate) & "-" & month(nowcalibrate) & "-" & day(nowcalibrate) & "/" uploadpath = "../" & path localpath = server.mappath(uploadpath) & "\" 'response.write localpath Set fso = Server.CreateObject("Scripting.FileSystemObject") if not fso.folderexists(localpath) then fso.createfolder(localpath) end if if not fso.folderexists(localpath) then response.write "Sorry, folder creation fail! (" & localpath & ")" response.end end if set fso = nothing Set Upload = Server.CreateObject("Persits.Upload") ' We must call Upload.Save or SaveToMemory before we can use Upload.Form! Upload.SetMaxSize 900000, True Upload.OverwriteFiles = false tmpuplcount = Upload.SaveVirtual(uploadpath) If Err.Number = 8 Then Response.Write "Your file is too large. Please try again." else 'Request Data ls_header = Upload.form("ls_header") ls_preview = Upload.form("ls_preview") ls_detail = Upload.form("theHTML") ct_id = Upload.form("ct_id") recorddate = now if err then ErrMSG = err.description err.clear else if tmpuplcount > 0 then ErrMsg = "Upload OK.
" For Each File in Upload.Files 'Check the file extension. If not GIF, JPG, BMP, or PNG do not display size Ext = UCase(Right(File.ExtractFileName, 3)) If Ext = "GIF" or Ext = "JPG" or Ext = "BMP" or Ext = "PNG" or Ext = "PSD" or Ext = "EPS" Then ErrMsg =ErrMsg & uploadpath & File.ExtractFileName & " (" & _ File.ImageWidth & " x " & File.ImageHeight & ")
" 'ADD RECORD previewImage = uploadpath & File.ExtractFileName qryimg ="INSERT INTO lifestyle(ls_head, ls_preview, ls_detail, ls_picture, ls_picturex, ls_picturey, ct_id, ls_record) VALUES(" & _ "'" & encode(ls_header) & "'" & _ ", '" & encode(ls_preview) & "' " & _ ", '" & encode(ls_detail) & "' " & _ ", '" & encode(path & File.ExtractFileName) & "' " & _ ", '" & encode(File.ImageWidth) & "' " & _ ", '" & encode(File.ImageHeight) & "' " & _ ", " & ct_id & " " & _ ", " & date2db(recorddate) & ")" 'response.write qryimg 'response.end Set rsImg = conn.execute(qryimg) Else ErrMsg =ErrMsg & uploadpath & File.ExtractFileName & " is not an image.
" End If Next else ErrMsg = "No file to be uploaded." 'ADD RECORD qrynoimg ="INSERT INTO lifestyle(ls_head, ls_preview, ls_detail, ct_id, ls_record) VALUES(" & _ "'" & encode(ls_header) & "'" & _ ", '" & encode(ls_preview) & "' " & _ ", '" & encode(ls_detail) & "' " & _ ", " & ct_id & " " & _ ", " & date2db(recorddate) & ")" 'response.write qrynoimg 'response.end Set rsnoImg = conn.execute(qrynoimg) end if end if 'response.write ErrMsg set rsnoImg = nothing set rsImg = nothing set rsIcon = nothing set Upload = nothing 'response.end end if %> :: SWDSBD Dot Com's Web Admin ::

 Save
   
Title :
<%=ls_header%>
Preview :
<%=ls_preview%>
Detail :
<%=ls_detail%>
Country :
<% qryCT = "select * from country where ct_id = "& ct_id &"" set rsCT = conn.execute(qryCT) if not rsCT.eof then response.write rsCT("ct_name") end if set rsCT = nothing %>