LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2014, 07:24 AM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 14.04
Posts: 1,532

Rep: Reputation: 43
load photos in webpage


I made a simple webpage for a girlfriend, published it by hostica.com

At home I put all 4 photos in a folder called fotos. I uploaded everything with Filezilla.

When I opened the page, the photos would not load. After I moved all the photos to a folder called images, which was already there,they loaded ok. In my files they were referenced as

Code:
<img src="fotos/headandshoulders.jpg" />
This worked fine at home.

I changed that to:

Code:
<img src="images/headandshoulders.jpg" />
This works on the net.

Why is that?
 
Old 06-09-2014, 12:45 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,266
Blog Entries: 12

Rep: Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862
This maybe should go into a different forum, such as Programming.

The standard directory to place images within in an HTML page is images. In fact, you do not need the text "http://www.linuxquestions.org/questions/images/" before each filename in the src= parts of the attribute.
Code:
<img src="headandshoulders.jpg" />
will work fine. Yes it does seem counter-intuitive in that it appears legal to use your first notation because you selected a sub-directory called "fotos"; however I've not had success using alternate sub-directory names either, I've always had to use "images".

I'm sure there are more detailed references, this is just a known thing to me but I searched a little for a reference that explains this http://www.htmlgoodies.com/primers/h...le.php/3478181 in the paragraph where it says "Placing An Image On Your Page".

Also, since I learned HTML by the seat of my pants and not via formal training, my answer is colored by trial and error based experience versus some substantive knowledge of the development of the language.

Last edited by rtmistler; 06-09-2014 at 12:48 PM.
 
1 members found this post helpful.
Old 06-09-2014, 04:29 PM   #3
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware{,-current}, OpenBSD
Posts: 377

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hi,

since you mention that a directory called "images/" was already there in your web space, maybe your hosting provider is expecting you to use it, and doesn't allow to override it. On the other hand, you might want to check the settings of your hosting account: perhaps the "images/" directory is defined somewhere and can be overridden by the user. I assume that your custom "fotos/" directory is at the same level as "images/", and that permissions are set correctly.

That said, I never had problems like this, either on my local server (Apache) or on the remote hosting space (Apache as well): I can use the names I want, and put directories and files wherever I want. However, if yours is a cheap hosting service then you might have some restrictions.

Regards,
Philip

Last edited by Philip Lacroix; 06-09-2014 at 04:36 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Linux on VMware cannot load any webpage, but ping works. Grtyop Linux - Newbie 4 09-12-2013 04:28 AM
Cannot load more than one webpage/download item on Wifi (Ubuntu 12.04) HolyMythos Linux - Newbie 1 05-18-2012 04:37 PM
embedded windows media in firefox? webpage won't load hedpe Linux - General 1 04-28-2005 06:07 PM
Webpage load time Windows=0,6sec Linux=+30sec !!!! RedDwarf Linux - Networking 0 08-07-2004 09:08 PM
Stalled WebPage Load/No Download DigitMole Mandriva 2 02-02-2004 05:09 PM


All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration