Answers.Body: <p>I had the same case, </p>
  
  <p>the "clean" solution was to set an absolute path to <strong>Image Directory</strong> and the corresponding absolute URL to <strong>Image Upload URL</strong></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-13T14:40:03.473Z
Answers.LastActivityDate: 2018-06-13T14:40:03.473Z
Answers.UserDisplayName: Bastien Ho
Answers.Body: <p>I ve had the same case,
  the check in  php is case sensitive so i convert all strings to lowercase before checking in the line below ( in uploader.php file ) and it works :<br />
  return (<strong>strtolower</strong>(substr($rPath, 0, strlen($this-&gt;typeDir))) === <strong>strtolower</strong>($this-&gt;typeDir));</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-24T14:39:19.453Z
Answers.LastActivityDate: 2020-09-24T14:39:19.453Z
Answers.UserDisplayName: Mohamed Jalid
Answers.Body: <p>After digging, i have found that the problem was in the function <code>packages/kcfinder/core/class/uploader.php :: checkFilePath</code></p>
  
  <p>This function forbids an upload if you have a symbolic link in your path.</p>
  
  <p>There is also a related issue in CiviCRM JIRA : <a href="https://issues.civicrm.org/jira/browse/CRM-15607" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-15607</a></p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Probably not a very good solution but you can patch kcfinder. </p>
  
  <p>In my case it's complicated to remove the symbolic link so I used this as a temporary fix.</p>
  
  <p>Add the following line as the first line of the function checkFilePath to avoid the verification:</p>
  
  <pre><code>     protected function checkFilePath($file) {
  +        return True;
           $rPath = realpath($file);
           if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN")
               $rPath = str_replace("\\", "/", $rPath);
           return (substr($rPath, 0, strlen($this-&gt;typeDir)) === $this-&gt;typeDir);
      }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-13T07:02:50.737Z
Answers.Text: Thanks, this fixed my problem too.  I guess it opens up a security hole in that up-loaders could potentially create symlinks to system files.  Then again, we only have a couple of CiviCRM admins so should be a small attack surface.
Answers.UserDisplayName: FGiorlando
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-21T16:11:53.807Z
Answers.LastActivityDate: 2015-09-21T20:28:30.353Z
Answers.LastEditDate: 2015-09-21T20:28:30.353Z
Answers.UserDisplayName: samuelsov
Body: <p>In CiviCRM 4.6.5, I'm not able to upload files with CKEditor.</p>
  
  <p>I get the very informative error <code>Unknown error</code></p>
  
  <p>It's seems to be a permission or problem like that when copying the file but without more information, it's difficult to find what it is. </p>
  
  <p>I have found the forum post <a href="https://forum.civicrm.org/index.php?topic=26908.0" rel="nofollow">https://forum.civicrm.org/index.php?topic=26908.0</a> but my problem is not one of those described. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-07T16:04:55.007Z
Comments.Text: i'm having the same problem in one of my installations, i'm able to upload, rename and delete files in my local installation but not in production. Can it be https issue? My local is http and production is https
Comments.UserDisplayName: Kboy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-02T10:36:39.420Z
Comments.Text: A little bit late, but very many thanks for this solution. Ik took me 2 days of searching and I found the answer here!
  Great, I'am happy!
Comments.UserDisplayName: Aadv
Tags: <issues><ckeditor>
Title: Error "Unknown Error" when uploading a file with CKEditor
ThreadText: # Error "Unknown Error" when uploading a file with CKEditor
  
  (Asked by: username_0 on 2015-09-21)
  
  In CiviCRM 4.6.5, I'm not able to upload files with CKEditor.
  
  I get the very informative error `Unknown error`
  
  It's seems to be a permission or problem like that when copying the file but without more information, it's difficult to find what it is.
  
  I have found the forum post <https://forum.civicrm.org/index.php?topic=26908.0> but my problem is not one of those described.
  
  **Tags:** issues, ckeditor
  
  > **Comments:**
  > **username_1**: i'm having the same problem in one of my installations, i'm able to upload, rename and delete files in my local installation but not in production. Can it be https issue? My local is http and production is https  
  > **username_2**: A little bit late, but very many thanks for this solution. Ik took me 2 days of searching and I found the answer here! Great, I'am happy!  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2015-09-21. Score: 5 | Accepted answer
  
  After digging, i have found that the problem was in the function `packages/kcfinder/core/class/uploader.php :: checkFilePath`
  
  This function forbids an upload if you have a symbolic link in your path.
  
  There is also a related issue in CiviCRM JIRA : <https://issues.civicrm.org/jira/browse/CRM-15607>
  
  **EDIT:**
  
  Probably not a very good solution but you can patch kcfinder.
  
  In my case it's complicated to remove the symbolic link so I used this as a temporary fix.
  
  Add the following line as the first line of the function checkFilePath to avoid the verification:
  
  ```
       protected function checkFilePath($file) {
  +        return True;
           $rPath = realpath($file);
           if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN")
               $rPath = str_replace("\\", "/", $rPath);
           return (substr($rPath, 0, strlen($this->typeDir)) === $this->typeDir);
      }
  
  ```
  
  > **Comments:**
  > **username_5**: Thanks, this fixed my problem too.  I guess it opens up a security hole in that up-loaders could potentially create symlinks to system files.  Then again, we only have a couple of CiviCRM admins so should be a small attack surface.  
  
  ---
  
  ### Answer by username_3 on 2018-06-13. Score: 2
  
  I had the same case,
  
  the "clean" solution was to set an absolute path to **Image Directory** and the corresponding absolute URL to **Image Upload URL**
  
  
  ---
  
  ### Answer by username_4 on 2020-09-24. Score: 0
  
  I ve had the same case,
  the check in php is case sensitive so i convert all strings to lowercase before checking in the line below ( in uploader.php file ) and it works :  
  return (**strtolower**(substr($rPath, 0, strlen($this->typeDir))) === **strtolower**($this->typeDir));
  
  
  ---
  
  