ASPsmartupload forhindre overskrivning?
Jeg har fået hjælp til nedenståend aspsmartupload og det virker fint, men hvorfor hindre man brugere i at uploade foto med samme filnavn?<%
Dim objUpload ' Definer en variabel til objektet
Set objUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
objUpload.MaxFileSize = 500000
On Error Resume Next
Dim strUploadPath ' Definer en variabel til stien
strUploadPath = "upload"
Dim intFileCount
objUpload.Upload
intFileCount = objUpload.Save(Server.MapPath(strUploadPath))
If Err Then
Response.Write "Der opstod en fejl :<br>" & vbCrLf
Response.Write Err.Description
Else
Response.Write intFileCount & " fil(er) uploadet.<br>" & vbCrLf
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("test.mdb")
Conn.Open DSN
strSQL = "UPDATE bruger SET File1='" & Replace(objUpload.Files.Item("File1").FileName, "'", "''") & "', File2='" & Replace(objUpload.Files.Item("File2").FileName, "'", "''") & "', File3='" & Replace(objUpload.Files.Item("File3").FileName, "'", "''") & "' WHERE id=" & Replace(objUpload.Form("id"), "'", "''")
Conn.Execute(strSQL)
Conn.Close
Set Conn = Nothing
End If
On Error Goto 0
Set objUpload = Nothing
%>
mvh rwj