sunhater / kcfinder

KCFinder web file manager
http://kcfinder.sunhater.com
403 stars 207 forks source link

unknown error when uploading images #135

Open deltaforce opened 8 years ago

deltaforce commented 8 years ago

I am using the kcfinder that comes with PHPList, and have updated it to the latest version. When trying to upload an image I just get "unknown error".

I am running on Windows server 2008 and the folder does have r/w/e permissions and files can be uploaded via other apps.

enumag commented 8 years ago

There are lot of cases when KCFinder throws "unknown error" so there is no way for anybody else to tell you what's wrong - you will have to debug it yourself. I've done it myself multiple times and it's not easy. By the way KCFinder is dead.

deltaforce commented 8 years ago

i'm not a php developer, so kinda hard for me to debug it myself. Am looking for other solutions now, PHPList is proving to be a bit of a PITA.

okwebsite commented 7 years ago

hi my kcfinder is Unknown error problem , when i installed ssl certificate for website and write code RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] to htaccsess then seen this error. But when the non-www enter page kcfinder worked! this class is problem protected function postDir($existent=true) { $dir = $this->typeDir; if (isset($_POST['dir'])) $dir .= "/" . $_POST['dir']; if (!$this->checkFilePath($dir)) $this->errorMsg("Unknown error"); if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); return $dir; }

fkfinder config : 'disabled' => false, 'uploadURL' => 'https://www.shop-intex.com/upload', 'uploadDir' => '',

blueleader07 commented 6 years ago

This worked for me... although it might not be the right solution.

Open the kcfinder/core/classes/browser.php

Comment out the line in the getFiles method that creates the thumbnail

                if (is_array($size) && count($size)) {
                    $thumb_file = "$thumbDir/" . basename($file);
                    if (!is_file($thumb_file))
                        //$this->makeThumb($file, false);
                    $smallThumb =
                        ($size[0] <= $this->config['thumbWidth']) &&
                        ($size[1] <= $this->config['thumbHeight']) &&
                        in_array($type, array("gif", "jpeg", "png"));
                } else
                    $smallThumb = false;

I'm not sure why that's causing a 500 error for me. But I've commented it out for now.