Reputation: 15
I have a list of images for users. In the database the images table has these columns:
I have uploaded these images to the server in a specific folder. Therefore, the only thing that should be done, is to search the folder for the correct fileName
for the logged-in user, and fetch the image.
When I login and view the gallery, I'd like to see my image on the screen. I've searched for it a long time, but no answer till now.
Upvotes: 0
Views: 709
Reputation: 11423
Not that clear question but i will try to solve it:
Get the file name according to the userId by some query .and store it in an
variable .
string dir = System.Web.HttpContext.Current.Server.MapPath("~") +
"/" + FolderName + "/" + FileNameVarWithExtinsion;
Set the ImageUrl by the the previous path.
Upvotes: 0
Reputation: 134
is that folder under your web applications iis folder? if not you have to create a virtual directory to that folder, so you can call it by url. eg. http://<your host>/<images folder(virtual directory)>/<user id>.jpg
Upvotes: 1