sum1 sum1 - 3 months ago 9
ASP.NET (C#) Question

Image is not displayed in browser when uploaded to server in ASP.NET

I have a project which works fine in local server.The Project however when uploaded in the real server, runs and shows no error but displays the broken image.The image are in the product folder inside img folder in the webroot.

I inspected the image and provided image path from the root directory and it works but when the image path is taken from inside folders as img/product/image.jpg, it shows broken image.

Any help would be much much appreciated.

EDIT:

I am checking the result with inspect elements.
The image tag is as

<img width="100%" src="/img/product/hs6.jpg">


The image hs6.jpg do exists then why won't it get displayed.
If i use the image from root, it would display

<img width="100%" src="career.jpg">


The above one is working good.

When i copy the image location it shows
http://sajilobazar.com/img/product/l7.jpg
.You can check in your browser.

Answer

I solved the error last night.There was nothing wrong in the path.I changed the folder name from img to myimg, built the solution and uploaded in the server and now its working good.

The Error i guess was due to use of img as a folder as img is itself a predefined tag or keyword.

Comments