Using the ASP.NET class csNetUpload to save files into a database.

This is a downloadable demo that uses the Chestysoft csNetUpload ASP.NET class to upload files and save them into a Microsoft Access database OLE Object field. The sample files also show how to retrieve the uploaded files and stream them to the web browser. The scripts use VB.NET.

To run the demo you need the csNetUpload trial component and the example script files:

Download the sample scripts - dbdemo.zip (9 KB)

Download the csNetUpload trial - csnut.zip (389 KB)

The sample files contain a text file, "readme.txt" which describes the demo and how to make it run. The following points should be noted.

First, the csNetUpload component is not included as part of the demo and it must be downloaded separately using the link above. It needs to be placed in the binary directory for the web application.

Second, the default settings in ASP.NET will not allow an Access database to be updated leading to an "Operation must use an updateable query" error. A quick workaround is to set the permissions on the Access .mdb file to allow Everyone to have Write permission. The recommended solution is to enable impersonation by adding the following line to your Web.config file:

<identity impersonate="true" userName="" password=""/>

For more details on this subject, see http://support.microsoft.com/?id=316675.

The script that saves the files to the database is "saveDB.aspx" and this is identical to the example shown in the component instructions provided in the zip file with the Chestysoft.csNetUploadTrial DLL.