Log in

View Full Version : Images not shown on website file


Sunaina
Apr 30, 2009, 03:04 PM
Hello guys,

I made a website, it works fine when I open it from the site root folder, but the images are not shown when I upload it to my website through FTP.

The file looks like this,

File:///C:/Users/Mahnoor/Desktop/NewWShop2/home.html

What I think is, it's file:/// is the problem... what you think?

Will you please guide me to fix the problem...

Many thanks.

BenReilly
Apr 30, 2009, 08:35 PM
Hi,

Yes the file:/// is the problem, the easiest way is to replace the code with the absolute location to the picture.
One example would be "http://www.yourdomain.com/picture.jpg" should you have an extra directory for the pics then it would look something like this "http://yourdomain.com/images/picture.jpg"
It is kind of tough not knowing the file structure. Which program did you use to create the site because most will give you an option to insert pictures that are relative to the file structure and will work instantly after uploading.

Most html editors allow to change the location of the picture by right clicking on it and click properties.

Hope that helps.

Sunaina
May 1, 2009, 11:15 AM
I used Dreamweaver my site... and yes I've used both ways to fix the problem e.g. by making an extraw folder just for images in a site root folder(destination folder)... and by putting all the html files and images in same folder... but it didn't help:(

Do have any idea why it happens?

Sunaina
May 1, 2009, 11:27 AM
My coding is like this,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hennas Corner</title>
<style type="text/css">
body {
background-color: #709343;
font-size: small;
font-family: Verdana, Geneva, sans-serif;
text-align: center ;
color: #030;
margin:0px;
width:955px;
line-height:1.5em;
}

#header {
background-color:#0709343;
width:955px;
margin:30px 0px 0px 150px;
}
#welcomeTxt {
background-color: #363;
width:955px;
margin:5px 0px 0px 150px;
text:#0709343;
padding:25px;
padding-left:0px;
padding-right:0px;
color: #300;
}
#footer {
width:905px;
margin:20px 0px 50px 150px;
padding:25px 25px 25px 25px;
color: #030;
background-color:#363;
}

#navcontainer{
padding:10px 10px 10px 10px;
margin:10px 0px 25px 145px;
list-style-type: none;
background-color:#300;
width:940px;
font:normal 90% arial, Arial, Helvetica, sans-serif;
text-align:center;
}


#navlist li {
display: inline;
list-style-type: none;
}

#navlist a { padding: 10px 30px 10px 30px; }

#navlist a:link, #navlist a:visited
{
color: #303 ;
background-color: #d67517;
text-decoration: none;
}

#navlist a:hover
{
color:#030;
background-color: #369;
text-decoration: none;
}
</style>
</head>

<body>

<div id="header">
<a href="home.html"><img src="header.jpg" alt="header-1" width="955px" /> </a>
</div>





<div id="navcontainer">
<ul id="navlist">
<li id="active">
<a href="home.html" id="current">Home</a></li>
<li><a href="about.html">About me</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="Fav.html">Favourites</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>


</body>
</html>

WebsiteSolution
May 1, 2009, 11:54 AM
When you inserted the photo through dreamweaver, did you select "relative to" document?

Insert
Image
Select Image Source box opens
Look all the way at the bottom for "relative to", click document

Sunaina
May 1, 2009, 12:33 PM
I've checked and it says

Relative to: Document

WebsiteSolution
May 1, 2009, 12:57 PM
Can you post a link to the page?

BenReilly
May 1, 2009, 01:04 PM
I do not see a problem in the code based on the part:
<div id="header">
<a href="home.html"><img src="header.jpg" alt="header-1" width="955px" /> </a>
</div>

It only shows the file:/// link when I start the file from Desktop like it should but on my webserver it works like it is supposed to.

WebsiteSolution
May 1, 2009, 01:08 PM
That's all I see also Bill in what she posted, that's why I want to see a link to the actual page, maybe we are missing something.

Sunaina
May 2, 2009, 07:12 AM
Here is the link

Wrkshops.freehostia.com

Sunaina
May 2, 2009, 07:16 AM
But when I open home.html file from the local root folder on my PC... it shows like this file:/// triple slashes...

File:///C:/Users/Mahnoor/Desktop/NewWShop2/home.html

WebsiteSolution
May 2, 2009, 07:32 AM
That's the problem. Like BenReilly stated earlier, if the file source is: file:///C:/Users/Mahnoor/Desktop/NewWShop2/home.html, that means it is loading from your desktop. It should be in a folder with the rest of the page files. For example, you directory should look something like:
c://Sample Directory/images/abcImage.jpg
(this would be your image folder)

Your page directory should look something like this:
c://Sample Directory/home.html

The entire directory should be uploaded to your website. If the photos still don't appear, that means you have not linked and uploaded everything properly

WebsiteSolution
May 2, 2009, 07:48 AM
At quick glance, I see that the color code is incorret for header - it has an extra "0" at the beginning of the color code. Also for some reason, none of your photos show up in the directory when they are clicked, something funky is going on -- probably something simple -- Ill look at the code later today when I have more time and try to figure something out.

Sunaina
May 4, 2009, 03:33 AM
Thats the problem. Like BenReilly stated earlier, if the file source is: file:///C:/Users/Mahnoor/Desktop/NewWShop2/home.html, that means it is loading from your desktop. It should be in a folder with the rest of the page files. For example, you directory should look somthing like:
c://Sample Directory/images/abcImage.jpg
(this would be your image folder)

Your page directory should look something like this:
c://Sample Directory/home.html

The entire directory should be uploaded to your website. If the photos still dont appear, that means you have not linked and uploaded everything properly

I don't really get this, what do u mean by (it should be in a folder with rest of files... ) bcoz all the file are already in the same folder called NewWshop2 which is placed on Desktop.

Make it clear.

insubbu
May 4, 2009, 04:25 AM
Hi Sunaina

Please send file structure of your root files
And I will tell you what's the problem

And I will be available on gmail chat [email protected]

Thanks

Sunaina
May 7, 2009, 01:54 PM
Help me in solving the problem:(

Sunaina
May 7, 2009, 01:55 PM
Anyone..

Golden_Girl
Sep 1, 2009, 07:47 PM
anyone.........?

Have you figured out the problem is yet Sunaina?