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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Unable to upload image in CiviMail
Pages: [1]

Author Topic: Unable to upload image in CiviMail  (Read 2372 times)

Ed van Velzen

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Unable to upload image in CiviMail
September 23, 2013, 06:34:32 am
Hi All,

I have problems uploading images to the server for using in the body of a CiviMail message. Civi tells me 'U heeft geen toestemming om bestanden te uploaden.' ('You are not authorized to upload files').

It must have something to do with file permissions, although the settings for /var/www/html/sites/default/files are wide enough. I have also read something about the KCFinder module, I have found the config.php file which says the upload folder is "" (not specified). CiviCRM has settings for the defualt folders for files and images that are uploaded, like /var/www/html/sites/default/files/civicrm/upload/ for temp files and /var/www/html/sites/default/files/civicrm/persist/contribute/ for images, but that should also be fine.

So to cut a long story short: I can't get this to work and I'm running out of options...

Any help is much appreciated.

Regards,

Ed van Velzen
Amnesty International

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Unable to upload image in CiviMail
September 23, 2013, 07:18:04 am

Might be easier and quicker to add some debug statements to where KCFinder spits out those error messages and trace it that way

a quick grep of the packages directory should find the right file to modify temporarily

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Unable to upload image in CiviMail
September 24, 2013, 12:49:10 am
That could be a good suggestion Lobo, not sure though how Ed's debug and grep skills are :-)
I will give it a try too, see what I can see ;D
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Ed van Velzen

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to upload image in CiviMail
September 26, 2013, 06:47:16 am
Thank you Donald and Erik for your suggestions. There is a uploader.php file in the ../packages/kcfinder/ folder that states the following:

...
        if ($config['disabled'] || !$config['access']['files']['upload']) {
            if (isset($file['tmp_name'])) @unlink($file['tmp_name']);
            $message = $this->label("You don't have permissions to upload files.");

        } elseif (true === ($message = $this->checkUploadedFile())) {
...

I have to be honest with you: PHP is not my favourite (as opposed to Java) but I feel the code snipplet above should give me a clue of where things go wrong. I'll look ito the complete file to see if I can understand what the base problem is...

Ed van Velzen

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to upload image in CiviMail
September 27, 2013, 06:30:04 am
I think I narrowed down the problem in the sense that I think it has to do with the session config for kcfinder. That session config in turn seems to rely on CRM/Core/Config.php. The bottomline is that kcfinder modules do not seem to have access to $this->config or at least it does not seem to contain values.

So... does anyone have a clue? By the way, the site runs on PHP 5.4.19.

Ed van Velzen

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to upload image in CiviMail
October 01, 2013, 05:24:49 am
This issue is solved now. I created a new config.php file that got picked up by the uploader.php file. One would say this problem has to be related to access rights, although the permissions for both the old and the new config file apparently are equal.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Unable to upload image in CiviMail
October 01, 2013, 06:15:47 am
Thanks for sharing the solution Ed, strange phenomena!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

ArthurC

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.32
  • PHP version: 5.3.27
Re: Unable to upload image in CiviMail
May 28, 2014, 11:59:07 am
On October 1 2013, Ed said "I created a new config.php file". Ed - would you share that file so I can do the same thing? Are you setting uploadDIR and/or uploadURL? Did you put it in ".../civicrm/packages/kcfinder/core" where uploader.php is located? Thanks, Arthur

letong

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL
  • PHP version: 5.3.13
Re: Unable to upload image in CiviMail
August 12, 2014, 06:03:19 pm
it would be great if you can provide more details on what you put in the new config.php file as I have the same problem of not being able to upload a file or an image

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Unable to upload image in CiviMail

This forum was archived on 2017-11-26.