Home

Primary links

  • top o the deck
  • Drupal for Beginners
  • about
  • links
  • give me some sugar

Drupal stuff

  • EDAM
  • STARDOM
  • Question Bank
  • Drupal musings
  • Drupal tips
Home

Key stuff on this site

Easy Drupal Admin Manual (EDAM)

SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)

Drupal for Beginners

Subscribe to posts by RSS or email

Subscribe to Drupal Ace by RSS feed RSS feed 

Subscribe to Drupal Ace by Email

Donate towards my web hosting bill! Get a great host!

Share and save

Share/Save

Random piece of content

Welcome to Your Site

Manuals on this site

  • Easy Drupal Admin Manual (EDAM)
    • Welcome to Your Site
    • First Steps: Please Read!
      • Understanding These Instructions
      • Important Terminology!
      • Best Practices for Site Admins
    • Super Quick Guide (for the experienced and the brave)
    • Logging In
    • Your Administrator Tools
    • Setting Site Basics
      • Setting Site Information
      • Configuring Your Theme
    • Creating Content
      • Node Types
      • Create a Page Node
      • Create a Story Node
      • Create a Blog Entry Node
      • Making Images and Other Files Available
      • Using Text and Image Editors
    • Organizing Your Content
      • Terms, Vocabularies, and Taxonomy: "Tagging" Your Content
        • Taxonomy Suggestions
      • Menus, Links, and Paths: Navigating the Site
        • Content Paths and URLs
        • Creating Links
        • Working with Menus: Administration Form (Drupal 6)
        • Working with Menus: Administration Form (Drupal 5)
        • Creating Menu Items on the Fly
        • Placing Menus on Your Pages
      • Placing Content on pages
        • Creating a page from a Single Node
        • Creating a page from a List of Nodes
        • Setting the Front Page
      • Working with Blocks
    • Maintenance Stuff
      • Maintenance and Construction Notices
    • Other Fun Things
      • Changing Color of Garland Theme
      • Free Aliases!
  • SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)
    • Set a Clear Goal
    • Make a Good Site
      • Put out the Welcome Mat
      • Make Great Content
      • Build a Great Brand
      • Make Navigation Easy
      • Tune Site Performance
    • Drive Traffic
      • Promote your Site
      • Get Found with SEO
    • Build a Community
      • Build an Offsite Community
    • Monitor and Improve
    • One-Page Checklist
    • Drupal and the Blogging Starter Checklist
      • Drupal and the Blogging Starter Checklist, Part 1
      • Drupal and the Blogging Starter Checklist, Part 2
      • Drupal and the Blogging Starter Checklist, Part 3
      • Drupal and the Blogging Starter Checklist, Part 4
      • Drupal and the Blogging Starter Checklist, Part 5
      • Drupal and the Blogging Starter Checklist, Part 6
      • Drupal and the Blogging Starter Checklist, Part 7

Recent comments

  • Deleting cookies

    Good point; thanks! Deleting cookies and/or caches, depending on the problem at hand, is a part...

  • It worked

    adding $GLOBALS['tempUser'] = $user; worked but I find it worth noting that I had to delete...

  • very good document...

    very good documentation for beginners!!!!!! thanks!!

  • del penitential 62

    strike out abject
    eliminate penitent 5

  • Chat

    Thank you a lot about very beneficial to my work was very useful thank you

more

How to fix broken image paths when changing download method from Private to Public?

Submitted by Drupalace on Tue, 2009-09-15 16:11
  • Drupal 6
  • images
  • unanswered question
Questions

This is a long-running question I've had. I can't find a forum post with exactly the same question, though this one comes close: http://drupal.org/node/489850

I have a site that's used the Private download method from the start. I'd like to switch to Public, so I can enable CSS optimization. Easy enough to do, and most images – logo, and images inserted into text via TinyMCE – are unaffected.

But I also have many nodes with images attached via the Images module, which adds an "Attached images" upload option to nodes. (Side note: Why it's labeled "Attached images" when it appears to allow attachment of only one image, I don't know.) Paths to those images break when switching download methods (which, fairly enough, warns in advance of such trouble).

The site is one of several on a single Drupal installation, so there's a path

drupal_directory/sites/site.com/

The file system path is set to

sites/site.com/files

The Image module adds to the above path – adding "/images" in my case – resulting in

sites/site.com/files/images

Images so far have been uploaded, by whatever means, to

drupal_directory/sites/site.com/files/images

This results in images which appear on pages to have the underlying URL

http://www.site.com/system/files/images/image.png

(It's my understanding that the "system/" that gets tossed in there is normal Drupal behavior.)

So far so good. But when switching to Public download, images uploaded via the Images module cease to display; the placeholder "broken image" square that appears instead has the wacky URL

http://www.site.com/sites/site.com/files/images/image.png

Even uploading a fresh image via "Attach images" doesn't fix things; the newly uploaded image still gains an unworkable URL. I'm stumped as to how to tell the Image module to fix that URL and look for the images in the normal place. Anyone know a solution?

Related URL: 

http://drupal.org/node/576732

Question answer: 

As of January 2010, I have no answer to the problem – but suddenly have no problem, either. In the kind of unsatisfying conclusion that happens time and again, I find that I can now change all affected sites to Public download, and even enable optimization of CSS and Javascript at Administer » Site configuration » Performance (which was the point of it all). After doing so, images display normally – even though the images still have the screwy addresses, like http://www.site.com/sites/site.com/files/images/image.png, that earlier resulted only in "image broken" placeholders.

That's if I'm logged in. If not logged in, image addresses have the nice expected form http://www.site.com/system/files/images/image.png. Can't these images make up their minds? But either way, they seem to display just fine.

So, what gives? I can't say. I don't recall making any major changes to the system that would affect this; perhaps it was simply an upgrade to the Image module somewhere between then and now (I'm currently running 6.x-1.0-alpha4).

If you've had this same problem, all I can suggest is trying the change from Private to Public again, especially if you've made any changes to Drupal or modules recently. Who knows, it just may suddenly work. 

Share/Save
  • Printer-friendly version
Unknown Drupaloid's picture

Did you see this?

Submitted by Unknown Drupaloid (not verified) on Sun, 2010-06-06 22:46.

http://drupal.org/node/258099

  • reply
Drupalace's picture

Fixing image paths

Submitted by Drupalace on Wed, 2010-06-09 17:31.

No, when I was looking for a fix, I didn't see that. Good info; it looks like it directly addresses the issue (and it's an issue that seems to pop up for plenty of users). 

My problem disappeared on its own somehow, so I don't have opportunity to further play with fixes right now. But I just know it'll hit me again someday, somewhere... so again, thanks for the pointer!

  • reply
Unknown Drupaloid's picture

test comment!

Submitted by Unknown Drupaloid (not verified) on Fri, 2009-09-18 14:23.

test comment!

  • reply

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><br><p>
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options


Relevant Content

The Drupal Ace logo has dealt these content suggestions from the deck.

  • Changing download method from Private to Public: Image problems solved (somehow)
  • Drupal New Site Setup Checklist
  • How to stop Drupal from logging error messages to screen?
  • Things theme different...
  • How to make Lightbox2 work for Views images and inline images?
  • More EDAM updates!
  • Flexible WYSIWYG editing for Drupal

Learn Drupal, hands-on

Get the beginner-friendly ebook that teaches community site building via a live case study.

Drupal 6 Ultimate Community Site Guide

Read the review

Drupal mini tip

The Book module creates "Printer-friendly version" at the bottom of Book pages. If you hit that link from a page with child pages, Drupal creates a printer-friendly page from that page and its child pages. If you hit the link from the Book's top page, you get the whole book in a single page!

It's a deal!

Dreamhost dealsDrupal Ace presides over his domain, proudly ensconced in his DreamHost eyrie. Won't you join me?

Promo code deal!

Just enter the code 49ER when you register for an account, and save $49 off the already-low price. No strings!

Read my hosting service review

Powered by Drupal, an open source content management system

Copyright 2007 and forever after. Made with Drupal, of course. On OS X, of course. Served up by DreamHost. DreamHost

RoopleTheme