When you add a product with the Manage\Products\Default.aspx page, you can add an image for the product. The product image is stored in the Products database table. Note The FileUpload control in is covered in Chapter 4, "Using the Rich Controls." The Manage\Products\Default.aspx page uses the standard ASP.NET FileUpload control to upload the image. The image is read from the FileUpload control and inserted into the database with the Product.InsertImage() method. To avoid clobbering the entire memory of your web server with a large image, this method adds the image to the database incrementally in 8040-byte chunks. The product images are displayed by the Default.aspx, Products.aspx, and ProductDetails.aspx pages. All these pages use a Generic Handler named ProductImage.aspx to retrieve the image. This handler retrieves the image in 8040-byte chunks from the database and sends the image bytes to the browser. Note Generic Handlers are discussed in Chapter 25, "Working with the HTTP Runtime." |