detta är ju helt knäppt!
jag vill ha så att den lägger till:
användarnamnet(session)
sen vilken spel det ska läggas i... men det går inte.. får bara en massa errors... har aldrig sett någon sådan här kod i ASP innan.. knäppt!
<HTML>
<BODY BGCOLOR="white">
<%
' Variables
' *********
Dim mySmartUpload
Dim file
Dim oConn
Dim oRs
Dim intCount
intCount=0
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Connect to the DB
' *****************
set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("db/config.mdb")
' Open a recordset
' ****************
'strSQL = "SELECT * FROM nobrain ORDER BY id DESC"
'strSQL = "SELECT * from files order by filename,FILE"
strSQL = "SELECT * from files order by filename"
Set oRs = Server.CreateObject("ADODB.recordset")
Set oRs.ActiveConnection = oConn
oRs.Source = strSQL
oRs.LockType = 3
oRs.Open
' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Add the current file in a DB field
' \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
oRs.AddNew
file.FileToField oRs.Fields("FILE")
oRs("filename") = file.FileName
oRs.Update
intCount = intCount + 1
End If
Next
' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "cfg"
' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp"
' Deny physical path
' *******************
mySmartUpload.DenyPhysicalPath = True
' Only allow files smaller than 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 50000
' 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("members/" & session("user"))
' sample with a physical path
' intCount = mySmartUpload.Save("c:\temp\")
' Trap errors
' ***********
If Err Then
Response.Write("<b>ERROR</b><br> You tried to upload something diffrent then: *.cfg, *.txt, *.exe")
Else
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.")
End If
' Destruction
' ***********
oRs.Close
oConn.Close
Set oRs = Nothing
Set oConn = Nothing
%>
</BODY>
</HTML>
jag klarar uploada filerna .... men dom sparars inte i databasen.. har försökt mixtra med koden som man fick till men det fungera inte.....


