jag försöker ändrar denna kod till aspsmartupload men i huvudet står det still... här är aspupload koden aspupload till aspsmartupload
<code>
<!-- #include file="adovbs.inc" -->
<%
Set Upload = Server.CreateObject("Persits.Upload")
' we use memory uploads, so we must limit file size
Upload.SetMaxSize 100000, True
' Save to memory. Path parameter is omitted
Count = Upload.Save("h:/SinStar/sinstar/pbilder")
' Obtain file object
Set File = Upload.Files("THEFILE")
If Not File Is Nothing Then
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("db/sin.mdb")&";pwd=losen"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Addera = "Select * From members Where id=" &Session("id")
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic
RecSet.Update
RecSet("image_blob") = File.Binary
RecSet("bild") = ("http://localhost/pbilder/")&File.FileName
RecSet("filesize") = File.Size
RecSet("hash") = Hash
RecSet("description") = Upload.Form("DESCR")
RecSet.Update
RecSet.Close
Connect.Close
Set RecSet = nothing
Set Connect = nothing
Session("meddelande") = "Din bild är uppladdad!"
Response.Redirect "install.asp?id=" & Session("id") & ""
End if
%>
</code>
och här kommer då min som jag pillar på
<code>
<!-- #include file="adovbs.inc" -->
<%
Dim MyUpLoad
Dim file
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.UpLoad
MyUpload.Save(Server.MapPath("pbilder/"))
DIM bild
bild = MyUpLoad.Files.Item(1).FileName
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("../../sys/sdb/sin.mdb")&";pwd=losen"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Addera = "Select * From members Where id=" &Session("id")
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic
RecSet.Update
RecSet("image_blob") = File.Binary
RecSet("bild") = ("http://localhost/pbilder/")&File.FileName
RecSet("filesize") = File.Size
RecSet("hash") = Hash
RecSet("description") = Upload.Form("DESCR")
RecSet.Update
RecSet.Close
Connect.Close
Set RecSet = nothing
Set Connect = nothing
Session("meddelande") = "Din bild är uppladdad!"
Response.Redirect "install.asp?id=" & Session("id") & ""
End if
%>
</code>