AspSmartUpload problemer
MøjnJeg har hentet et aspSmartUpload herinde, det virker som det skal , men hvis jeg vil udvide antallet af FILE felter så går der ged i den. Lige nu ser den således ud hvor man kan uploade 2 stk filer. Mit sp. lyder hvad skal jeg gøre hvis jeg fx. vil have den til at uploade 8 stk....og kan jeg ydermere have andre typer for input felter i samme form fx. et textarea???
Asp som kan uploade 2 stk filer..
<%
' Variables
' *********
Dim mySmartUpload
Dim file
Dim intCount
intCount=0
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If file.IsMissing = false Then
' Save the files with his original names in a virtual path of the web server
' **************************************************************************
file.SaveAs(server.mappath("../files/" & file.FileName))
if CStr(intCount) = "0" then
streng = streng & "'" & file.FileName & "', "
else
streng = streng & "'" & file.FileName & "'"
end if
' sample with a physical path
'file.SaveAs("c:\" & file.FileName)
' Tæl antal filer...
' ******************************************
intCount = intCount + 1
End If
Next
' Display the number of files which could be uploaded
' ***************************************************
set rs = Server.CreateObject("ADODB.Connection")
str = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("../db/ulla.mdb")
rs.open str
sql = "insert into Billedeserie(Billede1, Billede2) values(" & streng & ")"
'sql_2= "insert into Billedeserie (Overskrift, Tekst, Dato) values('" & Overskrift & "','" & Tekst & "','" & Dato & "')"
set rs = rs.execute(sql)
Response.Write("<BR>" & mySmartUpload.Files.Count & " files could be uploaded.<BR>")
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.<BR>")
%>