only for RuBoard

In this chapter, I discussed how .NET enables us to very easily implement file uploading from the client to the server using the HttpPostedFile and HtmlInputFile classes. I demonstrated different ways you can abstract information about the uploaded file including filenames, types, and sizes using some of the HttpPostedFile classes' members along with members of the System.IO namespace. We dove headfirst into how to enable the uploading of images and how to save those images back to your database. I then showed one method you can use to display images stored in a database by using a web form to implement the image and then in turn using that as the Image controls ImageUrl or an <img> html elements SRC attribute.

Specifically I went over the following subjects in this chapter:

  • Using the HtmlInputFile class to upload files to gain programmatic access to the uploaded file

  • Using the HttpPostedFile class to manipulate and extract information from the uploaded file

  • Saving uploaded images to your database

  • Displaying images derived from a database

The examples given in this chapter focused on BLOBS of the image type, but the code here can be applied to any type of BLOB. For instance, you can use Listing 13.5 to upload a Microsoft Word document and save it in your database. Then you can use Listing 13.6 to open it by hard coding the ImageID to that of the saved Word Document and directly requesting that page.

only for RuBoard

Programming Data-Driven Web Applications with ASP. NET
Programming Data-Driven Web Applications with ASP.NET
ISBN: 0672321068
EAN: 2147483647
Year: 2000
Pages: 170 © 2008-2017.
If you may any questions please contact us: