Basically what I've got is a problem when I'm trying to upload an image in an 'edit' page via the cms.
I have 6 images that are uploaded fine via a 'add product' page, then when I go to my edit page and for example change 1 of those images of the 6 and upload that, I get problems, but all is fine if when im in the 'edit' page I change another piece of data and submit.
I have included below the 2 pages that are used when 'editing' a selection.
IF NOT rsuserU.EOF THEN
artTitle = rsuserU( "art_Title" )
artCategory = rsuserU( "art_Category" )
artBriefDesc = rsuserU( "art_BDescription" )
artPrice = rsuserU( "art_Price" )
artPicFull = rsuserU( "art_ThumbFull" )
artFace = rsuserU( "art_ThumbFace" )
artHood = rsuserU( "art_ThumbHood" )
artExtra1 = rsuserU( "image_Extra1" )
artExtra2 = rsuserU( "image_Extra2" )
artExtra3 = rsuserU( "image_Extra3" )
artCaseDesc = rsuserU( "case_Text" )
artDialDesc = rsuserU( "dial_Text" )
artMovementDesc = rsuserU( "movement_Text" )
artMakerDesc = rsuserU( "maker_Text" )
artDatDesc = rsuserU( "dat_Text" )
artHeightDesc = rsuserU( "height_Text" )
artStatus = rsuserU( "art_Status" )
artMoonDisplay = rsuserU( "art_MoonDisplay" )
artDisplay = rsuserU( "art_Display" )
END IF
rsuserU.Close
FUNCTION SELECTED( firstVal, secondVal )
????IF cSTR( firstVal ) = cSTR( secondVal ) THEN
????????SELECTED = " SELECTED "
????END IF
END FUNCTION
%>
This is then submitted here:
if instr(Trim(Request.ServerVariables("HTTP_REFERER")),"addproduct_art.asp") or instr(Trim(Request.ServerVariables("HTTP_REFERER")),"updateproduct_art.asp") then
????Set Upload = Server.CreateObject("Persits.Upload")
????theCount = upload.save(server.mappath("..")&"\images\uploaded")
????
????dim arr(6), i
????i = 1
????For Each File in Upload.Files
??arr(i) =??File.FileName
??i = i + 1
????
????Next
????
????'Count = Upload.SaveVirtual("../upload")
????
????' Get the form variables
????addProduct = TRIM (Upload.Form("addProduct"))
????updateProduct = TRIM (Upload.Form("updateProduct"))
????deleteProduct = TRIM (Upload.Form("deleteProduct"))
????
????'response.write("delete=" & deleteProduct)
????
????delID = TRIM (Upload.Form("delID"))
????catID = TRIM (Upload.Form("catID"))
????artTitle = TRIM (Upload.Form("artTitle"))
????artCategory = TRIM (Upload.Form("artCategory"))
????artBriefDesc = TRIM (Upload.Form("artBriefDesc"))
????artPrice = TRIM (Upload.Form("artPrice"))
????artPicFull = TRIM (arr(1))
????artFace = TRIM (arr(2))
????artHood = TRIM (arr(3))
????artExtra1 = TRIM (arr(4))
????artExtra2 = TRIM (arr(5))
????artExtra3 = TRIM (arr(6))
????artCaseDesc = TRIM (Upload.Form("artCaseDesc"))
????artDialDesc = TRIM (Upload.Form("artDialDesc"))
????artMovementDesc = TRIM (Upload.Form("artMovementDesc"))
????artMakerDesc = TRIM (Upload.Form("artMakerDesc"))
????artDatDesc = TRIM (Upload.Form("artDatDesc"))
????artHeightDesc = TRIM (Upload.Form("artHeightDesc"))
????artStatus = TRIM (Upload.Form("artStatus"))
????artMoonDisplay = TRIM (Upload.Form("artMoonDisplay"))
????artDisplay = TRIM (Upload.Form("artDisplay"))
????origImage = TRIM(upload.Form("origImage"))
????origFImage = TRIM(upload.Form("origFImage"))
????origHImage = TRIM(upload.Form("origHImage"))
????origExtra1 = TRIM(upload.Form("origExtra1"))
????origExtra2 = TRIM(upload.Form("origExtra2"))
????origExtra3 = TRIM(upload.Form("origExtra3"))
????set upload = nothing
????
????'Assign Default Values
????
????IF artTitle = "" THEN
????????artTitle = "?????"
????END IF
????IF artCategory = "" THEN
????????artCategory = "?????"
????END IF
????IF artBriefDesc = "" THEN
????????artBriefDesc = "?????"
????END IF
????IF artPrice = "" THEN
????????artPrice = "?????"
????END IF
????IF artCaseDesc = "" THEN
????????artCaseDesc = "?????"
????END IF
????IF artDialDesc = "" THEN
????????artDialDesc = "?????"
????END IF
????IF artMovementDesc = "" THEN
????????artMovementDesc = "?????"
????END IF
????IF artMakerDesc = "" THEN
????????artMakerDesc = "?????"
????END IF
????IF artDatDesc = "" THEN
????????artDatDesc = "?????"
????END IF
????IF artHeightDesc = "" THEN
????????artHeightDesc = "?????"
????END IF
????IF artStatus = "" THEN
????????artStatus = "?????"
????END IF
????IF artMoonDisplay = "" THEN
????????artMoonDisplay = "?????"
????END IF
????IF artDisplay = "" THEN
????????artDisplay = "?????"
????END IF
????' Add new product
????????
????if artPicFull = "" then
????
????????Pimage = origImage
????
????else
????
????????Pimage = artPicFull
????
????end if
????
????if artFace = "" then
????
????????Fimage = origFImage
????
????else
????
????????Fimage = artFace
????
????end if
????????
????if artHood = "" then
????
????????Himage = origHImage
????
????else
????
????????Himage = artHood
????
????end if
????????
????
????if artExtra1 = "" then
????
????????Extra1 = origExtra1
????
????else
????
????????Extra1 = artExtra1
????
????end if
????
????if artExtra2 = "" then
????
????????Extra2 = origExtra2
????
????else
????
????????Extra2 = artExtra2
????
????end if
????
????if artExtra3 = "" then
????
????????Extra3 = origExtra3
????
????else
????
????????Extra3 = artExtra3
????
????end if
????
????if addProduct <> "" then
????strsqlM = "INSERT INTO eventDisplay " &_
????????"( art_Title, art_Category, art_BDescription, art_Price, art_ThumbFull, art_ThumbFace, art_ThumbHood, image_Extra1, image_Extra2, image_Extra3, case_Text, dial_Text, movement_Text, maker_Text, dat_Text, height_Text, art_Status, art_MoonDisplay, art_Display??) VALUES (" &_????
????????" '" & fixQuotes (artTitle ) & "', " &_
????????" '" & fixQuotes (artCategory ) & "', " &_
????????" '" & fixQuotes (artBriefDesc ) & "', " &_
????????" '" & fixQuotes (artPrice ) & "', " &_
????????" '" & fixQuotes (artPicFull ) & "', " &_
????????" '" & fixQuotes (artFace ) & "', " &_
????????" '" & fixQuotes (artHood ) & "', " &_
????????" '" & fixQuotes (artExtra1 ) & "', " &_
????????" '" & fixQuotes (artExtra2 ) & "', " &_
????????" '" & fixQuotes (artExtra3 ) & "', " &_
????????" '" & fixQuotes (artCaseDesc ) & "', " &_
????????" '" & fixQuotes (artDialDesc ) & "', " &_
????????" '" & fixQuotes (artMovementDesc ) & "', " &_
????????" '" & fixQuotes (artMakerDesc ) & "', " &_
????????" '" & fixQuotes (artDatDesc ) & "', " &_
????????" '" & fixQuotes (artHeightDesc ) & "', " &_
????????" '" & fixQuotes (artStatus ) & "', " &_
????????" " & fixQuotes (artMoonDisplay ) & ", " &_
????????" " & fixQuotes (artDisplay ) & " )"
????????????????????
????'rsuser.open strsql, conn
????On Error Resume Next
ConnM.Execute strsqlM
If Err <> 0 Then
??Response.Write "Error in query " & strsqlM
??Response.End
End If
????
????end if
????%>
????
????
??????
??????????cellspacing ="0" bgcolor="white">
????????
??????????Clock Title: |
??????????<%=artTitle%>?? |
????????
????????
??????????Category: |
??????????<%=artCategory%> |
????????
????????
??????????Brief Description: |
??????????<%=artBriefDesc%> |
????????
????????
??????????Price: |
??????????<%=artPrice%> |
????????
????????
??????????Picture of full length: |
??????????<%=Pimage%> |
????????
????????
??????????Picture of the face: |
??????????<%=Fimage%> |
????????
????????
??????????Picture of the hood: |
??????????<%=Himage%> |
????????
????????????????
??????????Extra Image 1: |
??????????<%=Extra1%> |
????????
????????
??????????Extra Image 2: |
??????????<%=Extra2%> |
????????
????????
??????????Extra Image 3: |
??????????<%=Extra3%> |
????????
????????
??????????Case Description: |
??????????<%=artCaseDesc%> |
????????
????????
??????????Dial Description: |
??????????<%=artDialDesc%> |
????????
????????
??????????Movement Description: |
??????????<%=artMovementDesc%> |
????????
????????
??????????Maker Description: |
??????????<%=artMakerDesc%> |
????????
????????
??????????Date Description: |
??????????<%=artDatDesc%> |
????????
????????
??????????Height Description: |
??????????<%=artHeightDesc%> |
????????
????????
??????????Status: |
??????????
??????????<%=artStatus%> |
????????
????????
??????????Moon Display: |
??????????<%=artMoonDisplay%> |
????????
????????
??????????Display: |
??????????
??????????<%=artDisplay%> |
????????
????????
?????????? |
?????????? Was added to the database |
????????
??????
????
????
????<%
end if
%>
<%
' Update Product
IF updateProduct <> "" THEN
????if artPicFull = "" then
????
????????Pimage = origImage
????
????else
????
????????Pimage = artPicFull
????
????end if
????????
????????
????if artFace = "" then
????
????????Fimage = origFImage
????
????else
????
????????Fimage = artFace
????
????end if
????
????if artHood = "" then
????
????????Himage = origHImage
????
????else
????
????????Himage = artHood
????
????end if
????
????if artExtra1 = "" then
????
????????Extra1 = origExtra1
????
????else
????
????????Extra1 = artExtra1
????
????end if
????
????if artExtra2 = "" then
????
????????Extra2 = origExtra2
????
????else
????
????????Extra2 = artExtra2
????
????end if
????
????if artExtra3 = "" then
????
????????Extra3 = origExtra3
????
????else
????
????????Extra3 = artExtra3
????
????end if
if artTitle = "" then
????strsqlM = "UPDATE eventDisplay SET " &_
????"art_Category='" & fixQuotes( artCategory ) & "', " &_
????"art_BDescription='" & fixQuotes( artBriefDesc ) & "', " &_
????"art_Price='" & fixQuotes( artPrice ) & "', " &_
????"art_ThumbFull='" & fixQuotes( Pimage ) & "', " &_
????"art_ThumbFace='" & fixQuotes( Fimage ) & "', " &_
????"art_ThumbHood='" & fixQuotes( Himage ) & "', " &_
????"image_Extra1='" & fixQuotes( Extra1 ) & "', " &_
????"image_Extra2='" & fixQuotes( Extra2 ) & "', " &_
????"image_Extra3='" & fixQuotes( Extra3 ) & "', " &_
????"case_Text='" & fixQuotes(artCaseDesc ) & "', " &_
????"dial_Text='" & fixQuotes(artDialDesc ) & "', " &_
????"movement_Text='" & fixQuotes(artMovementDesc ) & "', " &_
????"maker_Text='" & fixQuotes(artMakerDesc ) & "', " &_
????"dat_Text='" & fixQuotes(artDatDesc ) & "', " &_
????"height_Text='" & fixQuotes(artHeightDesc ) & "', " &_
????"art_Status='" & fixQuotes( artStatus ) & "', " &_
????"art_MoonDisplay=" & artMoonDisplay & ", " &_
????"art_Display=" & artDisplay & " " &_????
????" WHERE " &_
????"cat_ID=" & catID
????
else
????strsqlM = "UPDATE eventDisplay SET " &_
????"art_Title='" & fixQuotes( artTitle ) & "', " &_
????"art_Category='" & fixQuotes( artCategory ) & "', " &_
????"art_BDescription='" & fixQuotes( artBriefDesc ) & "', " &_
????"art_Price='" & fixQuotes(artPrice ) & "', " &_
????"art_ThumbFull='" & fixQuotes( Pimage ) & "', " &_
????"art_ThumbFace='" & fixQuotes( Fimage ) & "', " &_
????"art_ThumbHood='" & fixQuotes( Himage ) & "', " &_
????"image_Extra1='" & fixQuotes( Extra1 ) & "', " &_
????"image_Extra2='" & fixQuotes( Extra2 ) & "', " &_
????"image_Extra3='" & fixQuotes( Extra3 ) & "', " &_
????"case_Text='" & fixQuotes(artCaseDesc ) & "', " &_
????"dial_Text='" & fixQuotes(artDialDesc ) & "', " &_
????"movement_Text='" & fixQuotes(artMovementDesc ) & "', " &_
????"maker_Text='" & fixQuotes(artMakerDesc ) & "', " &_
????"dat_Text='" & fixQuotes(artDatDesc ) & "', " &_
????"height_Text='" & fixQuotes(artHeightDesc ) & "', " &_
????"art_Status='" & fixQuotes( artStatus ) & "', " &_
????"art_MoonDisplay=" & artMoonDisplay & ", " &_
????"art_Display=" & artDisplay & " " &_????
????" WHERE " &_??
????"cat_ID=" & catID
????
end if
ConnM.Execute strsqlM
%>
????
cellspacing="0" >
<%=artTitle%> was updated in the database
|
<%
END IF
%>
Edit Clock Information - If you want to edit information of a specific clock use the section below to select the Clock Title: |
<% strsqlM = "SELECT cat_ID, art_Title, art_Category FROM eventDisplay " &_ "ORDER BY cat_ID DESC"
set rs = server.createobject("adodb.recordset") rs.activeconnection = ConnM rs.open strsqlM WHILE NOT rs.EOF %>
"><%=rs( "art_Title" )%> - <%=rs( "art_Category" )%>
|
<% rs.MoveNext WEND
rs.close set rs = nothing
ConnM.close set ConnM = nothing %>
|