AspSmartUpload - gem filnavn i db
Ved godt at dette spg. har været stillet et par gange før, men jeg kan ikke få det til at virke - heller ikke selv om jeg har gennemlæst tidligere svar.Jeg har følgende sider:
Form.asp
----------------------------------------------------------
<HTML>
<BODY BGCOLOR="white">
<FORM METHOD="POST" ACTION="upload_2.asp" ENCTYPE="multipart/form-data">
<INPUT NAME="FILE1" TYPE="FILE" SIZE="50">
<BR>
<br>
<select name="kategori" id="kategori">
<option value="fest">fest</option>
<option value="privat">privat</option>
</select>
<br>
<br>
<INPUT TYPE="SUBMIT" class="knap" VALUE="Upload">
</FORM>
</BODY>
</HTML>
upload.asp
---------------------------------------------------------
<HTML>
<BODY BGCOLOR="white">
<%
' 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 not file.IsMissing Then
' Save the files with his original names in a virtual path of the web server
' ****************************************************************************
'file.SaveAs("/../Billeder" & file.FileName)
' sample with a physical path
file.SaveAs("D:\foto\slet\" & file.FileName)
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/081003_hs.mdb")
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Fotoalbum"
' KODE DER SKAL TILFØJE FIL-NAVNET I DATABASEN !!!!!
intCount = intCount + 1
End If
' Display the number of files which could be uploaded
' ***************************************************
Response.Write("<BR>" & mySmartUpload.Files.Count & " file(r) kunne blive uploaded.<BR>")
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(r) uploaded.<BR>")
Next
%>
</BODY>
</HTML>
Det jeg ønsker at gemme i databaser er: filnavn og kategori ( fra form.asp )
Indholdet skal gemmes i
FOTOALBUM
- FotoNavn
- FotoKategori
HJÆÆÆÆÆÆÆÆÆÆLLLLLP !!!!!!
