We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40314
    • 10 Posts
    Ok, so I have a folder (with thousands) of image files, both .gif and .jpg.

    I have been editing ModX locally (and everything worked perfectly!). I uploaded it to my server and suddenly only the .jpg files are viewable in my browser, none of the .gif files show up.

    If I try to directly load the .gif files, it loads a new page (my entire template) from modx, but no image.

    I do not have any hotlinking settings setup in cpanel.

    I did have SEO friendly URLs enabled, and I've tried disableing. I've removed the .htaccess file I setup, and tried uploading a backup with no luck.

    Any idea's as to what might cause this? Thank you in advance for the help.

    Example: ddbtrack.com (main page)
    http://ddbtrack.com/images/DrDave_homeLogo_05.gif (direct link to a gif file that won't load) [ed. note: marketermac last edited this post 14 years, 4 months ago.]
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Hello,

      Your server is case sensitive, so changing the address to: http://ddbtrack.com/images/drdave_homelogo_05.gif fixes the problem. I suspect your test server (/local computer) is windows?

        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 3749
        • 24,544 Posts
        If you develop locally, using the rule: all filename and directories -- all lower case, always, will save you a lot of grief. wink



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 40314
          • 10 Posts
          Thanks for the replies. I was taking an already developed website (on a windows server) and converting it to ModX while trying not to have to recreate everything from scratch (took info from the old CMS they were using). And so began my problems..


          I have tried mod_spelling with no luck. Does anyone know a way I can make a WHM / centos server case IN-sensitive? There are literally thousands of image files here that will suffer from this problem and I dread the task of renaming and re-coding all of that mess to make it work...
            • 32316
            • 387 Posts
            Sounds like time to ssh into the server, cd to the images folder, and use mv (the rename command) to change all the .GIF to .gif


            Be careful and have a backup in case you mess up!

            For me (MacOS X terminal - bash) I can use this:
            > cd path/to/images
            > for file in *.GIF; do mv "$file" "${file%GIF}gif"; done

            YMMV!!!!!!!!!


            Edit - I just took a look at the site (to make sure I was understanding the fix - think I am...
            the images currently use .GIF but the links are to .gif ... correct?
            and... the layout uses tables... rather you than me! [ed. note: whistlemaker last edited this post 14 years, 3 months ago.]
              • 40314
              • 10 Posts
              Thanks again! I'll give that a go tonight. I've got lots of backups, just uploading all of the images again on my internet doesn't sound that great either hah.

              It absolutely does tables. I'm sure google can answer my question and I'll look into it, but I never got the advantages of learning to use CSS to replace them. Guess I've got some reading to do.

              Also, I do believe that is one of the problems. Another problem is that acutal image file is something like (Image.gif) and it's called in the HTML with something like (ImaGe.gif). I do believe your fix can work on the file extension problems, but unless I can get this to recognize them as the same file, I'll have to modify the entire site to get it to recognize the (ImaGe.gif) files. [ed. note: marketermac last edited this post 14 years, 3 months ago.]
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                Ouch... If there's something I can't stand to see near about anywhere even when necessary, it's a table layout.

                FWIW, CSS really is the way to go and you'll be glad you did once you make the change. Don't worry if it seems complicated at first, if you're used to using inline formatting at all, you won't have too much to learn plus you'll only have to do your styling once instead of duplicating it in every freakin table cell.

                Taking a site out of tables does take some work however. Prepare for some hours, and also take advantage of the flexibility of MODX. Make chunks of table-less html, use css to style them. Use them to call up elements. It's really quite practical once you understand how it works.

                I have great respect for those who are able to use tables effectively. My eyes burn just looking at the html on table layouts.

                I wonder if it's possible to use .htaccess to allow for case in the filesystem (as opposed to folder)?


                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 32316
                  • 387 Posts
                  I do use tables for stuff that belongs in a table - works well for that. But never use it just for layout purposes. Drives me nuts trying to tweak or maintain a table based layout.

                  Anyway back to the original question.

                  As you might expect you are not the first to have this problem and if you do a search you may very well turn up a script that will change the case of the file names to all smalls - I know I did, but did not have time to test so I leave to the reader to do their own search and testing!

                  A good editor with grep search should be able to search for and change all the links in the html to all smalls if that is needed (I know the editor I commonly use - BBEdit - will do this, and to multiple files at once)

                    • 3749
                    • 24,544 Posts
                    See this: http://www.linuxjournal.com/content/convert-filenames-lowercase


                    If you don't have shell access, you could do it with a snippet containing a recursive function using scandir() to walk through the directories and rename the files to lowercase.

                    If you have mixed-case filenames in your code too, you could write a snippet using preg_replace() that would convert them to lowercase in all templates, chunks, and the content field of resources.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting