<% '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_id = Upload.form("ls_id") ls_header = Upload.form("ls_header") ls_preview = Upload.form("ls_preview") ls_detail = Upload.form("ls_detail") 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 ="update lifestyle set ls_head='" & encode(ls_header) & "', ls_preview='" & encode(ls_preview) & "', ls_detail='" & encode(ls_detail) & "', ls_picture='" & encode(path & File.ExtractFileName) & "', ls_picturex='" & encode(File.ImageWidth) & "', ls_picturey='" & encode(File.ImageHeight) & "', ct_id = "& ct_id &", ls_record=" & date2db(recorddate) & " where ls_id = "& ls_id &"" '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 ="update lifestyle set ls_head='" & encode(ls_header) & "', ls_preview='" & encode(ls_preview) & "', ls_detail='" & encode(ls_detail) & "', ct_id = "& ct_id &", ls_record=" & date2db(recorddate) & " where ls_id = "& ls_id &"" '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 %> <% qrySel = "select * from lifestyle where ls_id = "& ls_id &"" set rsSel = conn.execute(qrySel) %> :: SWDSBD Dot Com's Web Admin ::

 Edited.
   
Title :
<%=rsSel("ls_head")%>
Preview :
<%=rsSel("ls_preview")%>
Detail :
<%=rsSel("ls_detail")%>
Country :
<%=rsSel("ls_detail")%>
 
<% if len(rsSel("ls_picture")) > 0 then response.write imgsrc("../" & rsSel("ls_picture"), rsSel("ls_picturex"), rsSel("ls_picturey"), 200, 0) end if %>