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