Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Image field on Web Form
Message
 
À
31/05/2002 06:27:08
Fausto Garcia
Independent Developer
Lima, Pérou
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00663317
Message ID:
00664321
Vues:
20
Displaying an image from a database is a two part process - 1 to display the page that hosts the image and 2 to actually read and display the image. This can't happen on the same URL request because images are actually served separately from the HTML.

Hence you need two (or more depending how many images you dynamically serve) requests to actually handle the image. The code link from michael shows you how to read the data from the database - you can then serve that with Response.BinaryWrite() and the appropriate content type header as a separate request from teh HTML.

Personally I cannot think of a single reason why anyone would store images in a database - it's more work to maintain there, more work to retrieve and consumes extra resources. You're typically much better off putting an image path into the database and then pointing at the image on disk.


+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform