CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Broken profile images— misconfig in Civi or on server?
Pages: [1]

Author Topic: Broken profile images— misconfig in Civi or on server?  (Read 747 times)

choster

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
    • Lattice Group
  • CiviCRM version: 4.3,4.4,4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.39
  • PHP version: 5.5.15
Broken profile images— misconfig in Civi or on server?
April 23, 2014, 02:53:10 pm
Greetings, all. I've run into some unexpected behavior relating to uploaded images on CiviCRM 4.3.5.

I've tried two things: first, uploading a regular profile image to an individual contact (i.e. image_URL), and second, uploading the same image to a custom file field, but they produce broken results.

For some background, here is our setup:

Webroot/home/example/www/
Drupal files directory/home/example/www/sites/default/files
Temporary files/home/example/www/sites/default/files/civicrm/upload/
Custom files* (* outside webroot)/home/example/private/docs/privatedocs/
Images (premiums)*
(* probably not relevant, but still)
/home/example/www/sites/default/files/civicrm/persist/contribute/
CiviCRM Resources URLhttp://example.org/sites/all/modules/civicrm/
Image upload URLhttp://example.org/sites/default/files/civicrm/persist/contribute/

When I go to the View Contact screen for this particular contact, the photo thumbnail is broken. Its img src and destination are given as

Code: [Select]
[example.org]/home/example/private/docs/privatedocs/OurImage_dffdbfc1ed0a47cae024067572d424a5.jpg
In other words, it is giving the full server path instead of a URL which, at the very least, I would think has security implications. Suffice to say the thumbnail and the link to its larger version are both broken.

On the same screen, the custom field does show the correct thumbnail, but does not link to the right place.

Code: [Select]
[example.org]/sites/default/files/civicrm/custom/OurImage_eeb0d7a2a3060d038caa30e3b3bb0de3.jpg
What the heck? Why civicrm/custom? It's not mentioned in the resource URLs, system directors, or settings files; I have no idea where it comes from. The thumbnail itself is generated by

Code: [Select]
[example.org]/civicrm/file?reset=1&id=2&eid=17028
So then I checked to see where the images were actually uploaded to, and they are both in /home/example/private/docs/privatedocs.

When I try to create a Drupal View to display the images, the URLs provided match those on the View Contact screen:

Code: [Select]
/home/example/private/docs/privatedocs/OurImage_dffdbfc1ed0a47cae024067572d424a5.jpg (broken)
/sites/default/files/civicrm/custom/OurImage_eeb0d7a2a3060d038caa30e3b3bb0de3.jpg (broken)

So clearly, CiviCRM is generating some sort of temporary path to the images, but the paths it is generating are broken. Has anyone run across this before with uploaded files? Is this a server configuration problem, CiviCRM configuration problem, or a bug?

The only link which works is the thumbnail (example.org/civicrm/file?reset=1&id=2&eid=17028), though when you try to browse to that link directly, you get a redirect and a download prompt.

John Richardson

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 0
    • Life Challenge of Southeastern Michigan
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.27
  • PHP version: 5.3.13
Re: Broken profile images— misconfig in Civi or on server?
May 29, 2014, 10:44:06 am
I have a similar (I think) problem. Profile images are uploaded to files/civicrm/custom but the link to them is broken. No matter how a set the resource urls in either D7 or in CiviCRM, I get broken links to profile pix.
John Richardson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Broken profile images— misconfig in Civi or on server?

This forum was archived on 2017-11-26.