Monday 15 April 2013

c# - Retrieving Image using url stored in database -


I am collecting the user photo in a folder and in their URLs in my SQL database. The URLs are being stored and I am able to retrieve them, but when I connect this URL to ASP's ImageURL property: image control, the image is not being retrieved. Rather, I see only one empty box in my website. The URL stored in the database is a local file system URL, something like d: \ picture_files \ first_picture.jpg . When you send it to the browser, the browser tries to view it on the user's machine , not your server - because it comes in the form of a local URL.

What do you want is a webpage that gives an image, like 'show_image?' Imageid = 123` will see the request to the server, look at the image ID 123 in the database and send the image to the browser. This way your users will be able to see the picture.

No comments:

Post a Comment