Description:
|
FileUp supports chunked database inserts and updates with ADO.NET in SQL Server.
This is done using SQL Server's UPDATETEXT command and FileUp's SaveAsBlob override
to write chunks of data to a BLOB column.
By default, an uploaded file will overwrite a file on the server with the same name.
To prevent this, set OverwriteFilesto False.
|
ASP |
N/A
|
C# |
//--- Create an System.Data.SqlClient.SqlCommand reference
//--- using the 'UPDATETEXT' sql command, creating 'Pointer',
//--- 'Offset', and 'Delete' parameters so that FileUp
//--- can properly chunk data to the database column. SqlCommand cmd = new SqlCommand("UPDATETEXT " +
"Categories.Picture @Pointer @Offset " + "@Delete WITH LOG @Bytes", cn); SqlParameter inParam = cmd.Parameters.Add("@Pointer",
SqlDbType.Binary, 16);
//--- Call SaveAsBlob. fileUpload.SaveAsBlob(cmd, inParam, outParam);
|
VB.NET |
'--- Create an System.Data.SqlClient.SqlCommand reference
'--- using the 'UPDATETEXT' sql command, creating 'Pointer',
'--- 'Offset', and 'Delete' parameters so that FileUp
'--- can properly chunk data to the database column. Dim cmd As New SqlCommand("UPDATETEXT _ Categories.Picture @Pointer @Offset _ @Delete WITH LOG @Bytes", cn) Dim inParam As SqlParameter = cmd.Parameters.Add("@Pointer",_ SqlDbType.Binary, 16)
'--- Call SaveAsBlob. fileUpload.SaveAsBlob(cmd, inParam, outParam)
|
|