> hvad er problemet?
Problemet er ikke at når jeg poster formen så uploader den ganske rigtigt til
rigtig mappe, men stien sendes ikke til databasen.
form.asp
<form METHOD="POST" ACTION="SmartPost.asp" NAME="PW"
ENCTYPE="multipart/form-data">
<input TYPE="file" name="FILE1">
<input TYPE="file" name="TEXT">
<input TYPE="Submit">
SmartPost.asp
<%
On Error Resume Next
' Variables
' *********
Dim mySmartUpload
Dim intCount
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "jpg,gif"
' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp, htm, html, php, css"
' Deny physical path
' *******************
mySmartUpload.DenyPhysicalPath = True
' Only allow files smaller than 30000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 30000
' Deny upload if the total fila size is greater than 200000 bytes
' ***************************************************************
mySmartUpload.TotalMaxFileSize = 200000
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("../Upload")
' sample with a physical path
' intCount = mySmartUpload.Save("c:\temp\")
' Trap errors
' ***********
If Err Then
Response.Write("Nix")
Else
Response.Write(mySmartUpload.upload & " file(s) uploaded.")
End If
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("Database.mdb")
Conn.Open DSN
strSQl = "Insert into admin("
strSQL = strSQL & "Pic, "
strSQL = strSQL & "Password) "
strSQL = strSQL & "values( "
strSQL = strSQL & "'" & mySmartUpload.Form("FILE1") & "', " & "', "
strSQL = strSQL & "'" & mySmartUpload.Form("TEXT") & "') "
Response.write strSQL
Response.end
Conn.Execute(strSQL)
%>
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials