webForumDet fria alternativet

jobbigt problem

3 svar · 197 visningar · startad av aleborg

aleborgMedlem sedan jan. 20013 341 inlägg
#1

Jag håller på med en sida där man kan ladda upp bilder och skriva text.

När man har valt vilka bilder och skrivit text så får man se hur sidan blir och godkänna eller ändra, när man ändrar så får man upp formuläret igen med den text man har skrivit och man får även upp dom bilderna man har laddat upp, under bilderna så finns en checkbox där man kan välja om man vill spara bilden eller ladda upp ny!

Problemet är att om man väljer bort en bild och laddar upp en ny så försvinner dom andra bilderna(som man vill spara)

<%
if len(mySmartUpload.Files(1).Filename) > 0 Or len(mySmartUpload.Files(2).Filename) > 0 Or len(mySmartUpload.Files(3).Filename) > 0 then
If Session("Prespic")="" then
newfolderpath = Server.MapPath("\upload\product\"& mySmartUpload.Form("Artnr") &"")
set filesys=CreateObject("Scripting.FileSystemObject") 
If Not filesys.FolderExists(newfolderpath) Then 
   Set newfolder = filesys.CreateFolder(newfolderpath) 
End If
End If

'  Save the files with their original names in a virtual path of the web server
'  ****************************************************************************
   intCount = mySmartUpload.Save("/upload/product/"& Session("Artnr") &"")
   ' sample with a physical path 
   ' intCount = mySmartUpload.Save("c:\temp\")
Session("Text1")= replace (mySmartUpload.Form("Text1"), "'", "''")
Session("Text2")= replace (mySmartUpload.Form("Text2"), "'", "''")
Session("Text3")= replace (mySmartUpload.Form("Text3"), "'", "''")
Session("Aktiv")= replace (mySmartUpload.Form("Aktiv"), "'", "''")
For each file In mySmartUpload.Files
Session(file.name)=file.filename
next
If mySmartUpload.Form("Keep1")="yes" then
Session("Pic1")=Session("Pic1")
Else
Session("Pic1")= mySmartUpload.Files(1).Filename
End If
If mySmartUpload.Form("Keep2")="yes" then
Session("Pic2")=Session("Pic2")
Else
Session("Pic2")= mySmartUpload.Files(2).Filename
End If
If mySmartUpload.Form("Keep3")="yes" then
Session("Pic3")=Session("Pic3")
Else
Session("Pic3")= mySmartUpload.Files(3).Filename
End If
Else
Session("Text1")= replace (mySmartUpload.Form("Text1"), "'", "''")
Session("Text2")= replace (mySmartUpload.Form("Text2"), "'", "''")
Session("Text3")= replace (mySmartUpload.Form("Text3"), "'", "''")
Session("Aktiv")= replace (mySmartUpload.Form("Aktiv"), "'", "''")
If mySmartUpload.Form("Keep1")="yes" then
Session("Pic1")=Session("Pic1")
Else
Session("Pic1")= ""
End If
If mySmartUpload.Form("Keep2")="yes" then
Session("Pic2")=Session("Pic2")
Else
Session("Pic2")= ""
End If
If mySmartUpload.Form("Keep3")="yes" then
Session("Pic3")=Session("Pic3")
Else
Session("Pic3")= ""
End If
End If
%>

har jag förklarat tillräckligt? :e

SNÄLLA HJÄLP!!!

------------------
Data-Doktorn

aleborgMedlem sedan jan. 20013 341 inlägg
#2

någon vänlig själ som kan hjälpa mig?

------------------
Data-Doktorn

aleborgMedlem sedan jan. 20013 341 inlägg
#3

ska tillägga att bilderna inte raderas utan Session för dom bilderna man vill behålla blir tomma om man laddar upp EN ny bild

------------------
Data-Doktorn

aleborgMedlem sedan jan. 20013 341 inlägg
#4

lyckades lösa det :e

------------------
Data-Doktorn

131 ms totalt · 3 externa anrop · v20260731065814-full.fb544a5a
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)