Kig lige på
http://www.nettuelt.dk her er der en sådan mulighed.
Dette sker dog i to tempi, men jeg er sammen med udviklernee af denne hjemmeside, ved at lave et nyt script, der gør det i ét hug....
------ Alternativt er der denne lille stump kode ----
<html><head>
<title>Sample database upload via ASP</title>
<meta name=\"description\" value=\"Demonstrates using of the ByteArray class for working with binary data from Request.BinaryRead.\">
<%=Style()%>
</head>
<%=Body()%>
<form method=post ENCTYPE=\"multipart/form-data\">
File : <input type=\"file\" name=\"DBFile\"><br>
Title : <input size=\"80\" name=\"Title\" value=\"Title of the file.\"><br>
Description : <textarea cols=\"80\" rows=\"5\" name=\"Description\">Type description of file.</textarea><br>
<input type=\"submit\" Name=\"Action\" value=\"Upload the file\">
</form>
<hr><font size=1>Sample database upload via ASP from <a href=http://www.pstruh.cz>PSTRUH Software</a>.</font>
<br>
</body>
</HTML>
<!--#INCLUDE FILE=\"upload.inc\"-->
<!--#INCLUDE FILE=\"format.inc\"-->
<!--#INCLUDE FILE=\"db.inc\"-->
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
\' Option Explicit
\'Some value greater than default of 60s (According to upload size.)
\'The maximum speed is about 100kB/s for IIS4, P200 and local upload, 4kB/s for modem users.
Server.ScriptTimeout = 200
Const LogSeparator = \", \"
\'All uploaded files and log file will be saved to the next folder :
Dim DestinationFolder, LogFolder
DestinationFolder = Server.MapPath(\".\")
LogFolder = DestinationFolder
If Request.ServerVariables(\"REQUEST_METHOD\") = \"POST\" Then \'Request method must be \"POST\" for get the fields
BeginTimer \'Starts timer.
\'************************************************* Main Upload - start
Dim Fields
\' on error resume next
\'Gets uploaded fields
Set Fields = GetUpload()
\'There are all of form fields in the Fields object. Example :
\'Fields.Item(\"File1\").ContentType - content type of File1 field
\'Fields.Item(\"File1\").Value.String - File1 field converted to a string
\'Fields.Item(\"File1\").Value.ByteArray - File1 field as safearray to store in binary RS field or file
\'Fields.Item(\"Comments\").Value.String - value of Comments field
If Err = 0 Then \'Upload was OK
\'Saves fields to the database and returns result to the client.
Response.Write DBSaveUpload(Fields)
Else \'Error in upload. Write the error
Response.Write Err.Description
End If
On Error Goto 0
Fields = Empty \'Clear the variable
\'************************************************* Main Upload - end
EndTimer \'Writes info about consumed time.
End If \'Request method must be \"POST\"
Function DBSaveUpload(Fields)
Dim Conn, RS
Set Conn = GetConnection \'See db.inc
Set RS = Server.CreateObject(\"ADODB.Recordset\")
RS.Open \"Upload\", Conn, 2, 2
RS.AddNew
RS(\"UploadDT\") = Now()
RS(\"RemoteIP\") = Request.ServerVariables(\"REMOTE_ADDR\")
RS(\"ContentType\") = Fields(\"DBFile\").ContentType
RS(\"SouceFileName\") = GetFileName(Fields(\"DBFile\").FileName)
RS(\"Description\") = Fields(\"Description\").Value.String
RS(\"Title\") = Fields(\"Title\").Value.String
RS(\"Data\") = Fields.Item(\"DBFile\").Value.ByteArray
RS.Update
RS.Close
Conn.Close
DBSaveUpload = \"File <b>\" & GetFileName(Fields(\"DBFile\").FileName) & \"</b>, length : <b>\" & LogFn(Fields.Item(\"DBFile\").Value.Length) & \" B</b> was saved to the database. \"
End Function
</SCRIPT>
mvh martens