SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2012
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    images not loading

    I'm having an issue with loading images. I recently added new images but the image doesn't show up, only the alt shows up. As far as I can tell I have the code correct. Here is an example
    HTML Code:
    <img src="/images/image.png" alt="image" width="33" height="32" />

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,588
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    The code is fine. Yu probably just have a wrong path to the file, or the image file is not there. That path is looking for an image called image.png (all lower case) inside a folder called "images" (all lower case) inside your root folder.

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2012
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    The code is fine. Yu probably just have a wrong path to the file, or the image file is not there. That path is looking for an image called image.png (all lower case) inside a folder called "images" (all lower case) inside your root folder.
    In regards to referencing files in HTML, must we pay attention to things being case-sensitive? Or does this depend whether the site is hosted on an HTML or a Linux server?

  4. #4
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,315
    Mentioned
    213 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by Pamela1991 View Post
    In regards to referencing files in HTML, must we pay attention to things being case-sensitive? Or does this depend whether the site is hosted on an HTML or a Linux server?
    Linux is definitely case-sensitive. I have a feeling Windows is not (I'm sure that's what you meant ), but I'd say you should get into the habit of being accurate and ensuring your file names match to avoid any possible problems. The easiest way is probably to use lower-case for everything - although that offends the grammar-fiend in me when it comes to proper nouns.

    Edit: I've just found this on Wikipedia:
    In Unix filesystems, filenames are usually case-sensitive. Current Windows filesystems (VFAT, FAT32, NTFS) are not case-sensitive (there cannot be a readme.txt and a Readme.txt in the same folder) but are case-preserving, i.e. remembering the case of the letters. The original FAT12 filesystem was case-insensitive
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2012
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    Linux is definitely case-sensitive. I have a feeling Windows is not (I'm sure that's what you meant ), but I'd say you should get into the habit of being accurate and ensuring your file names match to avoid any possible problems. The easiest way is probably to use lower-case for everything - although that offends the grammar-fiend in me when it comes to proper nouns.

    Edit: I've just found this on Wikipedia:

    Thanks for clearing that up, TechnoBear!

    I wonder what would happen if from within Linux on a FAT32 file system USB drive, you made two files--readme.txt and Readme.txt in the same folder--and then tried accessing that USB drive and folder from Windows?

    Perhaps I'll try this using a liveboot Linux CD to see what happens.

  6. #6
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,315
    Mentioned
    213 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by Pamela1991 View Post
    I wonder what would happen if from within Linux on a FAT32 file system USB drive, you made two files--readme.txt and Readme.txt in the same folder--and then tried accessing that USB drive and folder from Windows?

    Perhaps I'll try this using a liveboot Linux CD to see what happens.
    I've no idea what would happen, but I'd be interested to find out.

    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  7. #7
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Pomona, California, United States
    Posts
    7
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ugh good luck getting windows to read that format.. even when i think i do everything right it still sometimes doesn't want to be nice

  8. #8
    SitePoint Zealot
    Join Date
    Mar 2012
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just now tried it by doing a live boot with Ubuntu (9.10 if it makes a difference). I made a new file on a FAT32 formatted USB drive, "Readme.txt". Then I made another new file and failingly tried to rename it to "readme.txt" but got the error
    Code:
    The item could not be renamed.
    
    The name "readme.txt" is already used in this folder. Please use a different name.
    It seems that the reason for this is because the file system itself is one that is native to Windows (like the ones you quoted from Wikipedia: VFAT, FAT32, NTFS). I say this because I then tried the exact above procedure on the local Linux file system, and I was able to have both files, readme.txt and Readme.txt, in the same directory just fine!

  9. #9
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,315
    Mentioned
    213 Post(s)
    Tagged
    5 Thread(s)
    Off Topic:

    Quote Originally Posted by Pamela1991 View Post
    I just now tried it by doing a live boot with Ubuntu (9.10 if it makes a difference). I made a new file on a FAT32 formatted USB drive, "Readme.txt". Then I made another new file and failingly tried to rename it to "readme.txt" but got the error
    Code:
    The item could not be renamed.
    
    The name "readme.txt" is already used in this folder. Please use a different name.
    Thanks for testing that - it's an interesting result and not what I expected.

    Quote Originally Posted by Pamela1991 View Post
    It seems that the reason for this is because the file system itself is one that is native to Windows (like the ones you quoted from Wikipedia: VFAT, FAT32, NTFS).
    Good theory.

    Quote Originally Posted by Pamela1991 View Post
    I say this because I then tried the exact above procedure on the local Linux file system, and I was able to have both files, readme.txt and Readme.txt, in the same directory just fine!
    Yep - I know that works, because I once did it accidentally and got myself no end confused.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •