Pregunta

En general, si queremos mostrar una imagen en la página web, nos damos el URI del recurso de imagen como: http: // host:. puerto / imagen / xxx.jpg

Ahora, hay algunas imágenes en mi sistema de archivos, y guardar su ruta absoluta en el PP.

Al igual que este;

id     name     address   image
1      xxxx     xxxx      C:/images/xxx.jpg

Ahora bien, si se retrived la entidad, su imagen debe mostrarse en la página.

Cómo hacer?

Lo que pensé es copiar la imagen bajo el directorio de servidor web, y luego construir su URL, la página puede hacerla. Pero me pregunto si esto es una buena idea? ¿Hay alguna otra manera?

¿Fue útil?

Solución

You could create a webpage or a httphandler which retrieves the requested image from the database then send it to the user using httpresponse and the correct mimetype. Using the querystring the image is identified like:

Unfortunately you didn't specify the programming language you are using. If its .Net I could create some example code.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top