Object: | SoftArtisans.FileUp | ||
Syntax: | SaveAsBlob([in] ADOField) | ||
Description: |
This method saves an uploaded file to a database. AppendChunk method. Any OLEDB provider that supports the AppendChunk method can
be the destination of a SaveAsBlob.
For Microsoft SQL Server, the column should be of 'image' or 'text' type. his distribution includes a sample SQL script that you can use to create tables for use in uploading files. See the Setup Instructions for uploading to a database on the server. For Microsoft Access, the column should be 'OLE Object'. You can use the sample Access database included with this distribution (in the Samples directory) for downloading and uploading files. When writing to BLOB (Binary Large OBject) fields, the ADO Recordset's cursor type must be adOpenDynamic (i.e., 2). Any size limitations of the BLOB field is imposed by the database. The uploaded data is stored exactly as sent, with no interpretation. If there is more than one file being uploaded in a single page, only the first one is saved. To save multiple files in a single upload, there is an equivalent method for each file object, i.e., fileUpload.Form("File1").SaveAsBlob rs("FileCol"). By default, an uploaded file will overwrite a file on the server with the same name. To prevent this, set OverwriteFilesto False.
|
||
See Also: | ADO.NET and SaveAsBlob | ||
Examples: | |||
|