Uploader Not Working Issue Solved

User's avatar
David L.
21:19 Dec 15, 2014
I cannot get the uploader action to work, this is my ckeditor /config.js set up:
CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	// config.uiColor = '#AADC6E';
        config.extraPlugins = 'doksoft_easy_file';
        config.toolbar_name = 'doksoft_easy_file';
        config.doksoft_uploader_url = 'http://mctimoneyanimal.co.uk/catalog/view/javascript/ckeditor/plugins/doksoft_uploader';   
};

The button is showing and allows me to select the file, but the upload action is not working. Please could you help me resolve this issue.
Kind Regards,
David
 FileUpload.jpg   69.4 KB
Support team avatar
JS+
09:51 Dec 16, 2014
Are you using PHP or .NET version of uploader?
I guess you are using PHP version. In that case:
1) Try to comment out lines with
config.doksoft_uploader_url
and its value. Usually it can be detected automatically and there is no need to specify it.
2) If you really need to specify doksoft_uploader_url please try this:
config.doksoft_uploader_url = 'http://mctimoneyanimal.co.uk/catalog/view/javascript/ckeditor/plugins/doksoft_uploader/uploader.php';
It must be a link to your PHP uploader script.
User's avatar
David L.
13:49 Dec 17, 2014
Thank you for your prompt response, I have added the full URL and now it attempts to upload and it gives a HTTP error (see screenshot)

Please could you give further advice
 HTTPerror.jpg   86.4 KB
User's avatar
David L.
14:14 Dec 17, 2014
I have got one step further, it now attaches the file, but the file link is corrupt and doesn't give the full link

http://admin/view/javascript/ckeditor/plugins/doksoft_uploader/userfiles/Dog%20Behaviour%20for%20the%20Practitioner.pdf
User's avatar
David L.
14:33 Dec 17, 2014
I have changed the config file to change link url

<?php

// Absolute URL to upload folder via HTTP.
// Will affect to client (JS) part of plugins.
// By default script is configured to automatically detect it.
// If you want to change it, do it like this:
$config['http://www.mctimoneyanimal.co.uk/admin/view/javascript/ckeditor/plugins/doksoft_uploader/userfiles/'] = 'http://yoursite.com/ckeditor_or_tinymce/plugins/doksoft_uploader/userfiles/';
$config['BaseUrl'] = preg_replace('/(uploader\.php.*)/', 'userfiles/', $_SERVER['PHP_SELF']);

// Absolute or relative path to directory on the server where uploaded files will be stored.
// Used by this PHP script only.
// By default it automatically detects the directory.
// You can change it, see this example:
$config['http://www.mctimoneyanimal.co.uk/admin/view/javascript/ckeditor/plugins/doksoft_uploader/userfiles/'] = "/var/www/ckeditor_or_tinymce/doksoft_uploader/userfiles/";
$config['BaseDir'] = dirname(__FILE__).'/userfiles/';

$config['ResourceType']['Files'] = Array(
'maxSize' => 0, // maxSize in bytes for uploaded files, 0 for any
'allowedExtensions' => '*' // means any extensions are allowed
);

$config['ResourceType']['Images'] = Array(
'maxSize' => 16*1024*1024, // maxSize in bytes for uploaded images, 0 for any
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
);

$config['JPEGQuality'] = 95; // Will be used for resizing JPEG images

// Some restrictions to avoid server overload / DDoS
$config['MaxImgResizeWidth'] = 2000;
$config['MaxImgResizeHeight'] = 2000;
$config['MaxThumbResizeWidth'] = 500;
$config['MaxThumbResizeHeight'] = 500;

$config['AllowExternalWebsites'] = ''; // Crossdomain upload is disabled by default
// If you want to enable it use this code:
// $config['AllowExternalSites'] = 'http://yoursite.com';
// or to allow all websites (with caution!):
// $config['AllowExternalWebsites'] = '*';



if (substr($config['BaseUrl'], -1) !== '/')
$config['BaseUrl'] .= '/';
if (substr($config['BaseDir'], -1) !== '/' && substr($config['BaseDir'], -1) !== '\\')
$config['BaseDir'] .= '/';

?>

is this correct?
User's avatar
David L.
15:24 Dec 17, 2014
I have tried and tried with the uploader config, I cannot seem to get the download link to have the full URL

it is just giving me the part url

http://admin/view/javascript/ckeditor/plugins/doksoft_uploader/userfiles/Dog%20Behaviour%20for%20the%20Practitioner.pdf

which is missing the 'www.mctimoneyanimal.co.uk/"

Please could you help me with the config file

<?php

// Absolute URL to upload folder via HTTP.
// Will affect to client (JS) part of plugins.
// By default script is configured to automatically detect it.
// If you want to change it, do it like this:
// $config['BaseUrl'] = 'http://yoursite.com/ckeditor_or_tinymce/plugins/doksoft_uploader/userfiles/';
$config['BaseUrl'] = preg_replace('/(uploader\.php.*)/', 'userfiles/', $_SERVER['PHP_SELF']);

// Absolute or relative path to directory on the server where uploaded files will be stored.
// Used by this PHP script only.
// By default it automatically detects the directory.
// You can change it, see this example:
// $config['BaseDir'] = "/var/www/ckeditor_or_tinymce/doksoft_uploader/userfiles/";
$config['BaseDir'] = dirname(__FILE__).'/userfiles/';

$config['ResourceType']['Files'] = Array(
'maxSize' => 0, // maxSize in bytes for uploaded files, 0 for any
'allowedExtensions' => '*' // means any extensions are allowed
);

$config['ResourceType']['Images'] = Array(
'maxSize' => 16*1024*1024, // maxSize in bytes for uploaded images, 0 for any
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
);

$config['JPEGQuality'] = 95; // Will be used for resizing JPEG images

// Some restrictions to avoid server overload / DDoS
$config['MaxImgResizeWidth'] = 2000;
$config['MaxImgResizeHeight'] = 2000;
$config['MaxThumbResizeWidth'] = 500;
$config['MaxThumbResizeHeight'] = 500;

$config['AllowExternalWebsites'] = ''; // Crossdomain upload is disabled by default
// If you want to enable it use this code:
// $config['AllowExternalSites'] = 'http://yoursite.com';
// or to allow all websites (with caution!):
// $config['AllowExternalWebsites'] = '*';



if (substr($config['BaseUrl'], -1) !== '/')
$config['BaseUrl'] .= '/';
if (substr($config['BaseDir'], -1) !== '/' && substr($config['BaseDir'], -1) !== '\\')
$config['BaseDir'] .= '/';

?>
Support team avatar
JS+
06:44 Dec 18, 2014
The
$config['BaseURL']
option can work in automatic mode in most of cases too.
Just leave it unmodified (such it was before you have edited it) and try.
If it does not works, set it in this way:
$config['BaseUrl'] = 'http://your-website.com/path/to/ckeditor/plugins/doksoft_uploader/userfiles/';
User's avatar
David L.
18:50 Dec 18, 2014
Hi
I am so sorry for these problems and I do appreciate your support and patience, the http error has now returned.

I have added in the php.ini files, which is normally the cause, please could you advise if there are any other known causes of the HTTP error (see screenshot)
 HTTPerror.jpg   86.4 KB
Support team avatar
JS+
05:41 Dec 20, 2014
To know more about a problem you need to inspect the network activity. Go to the page with the editor, press F12 in Chrome or Firefox (it will open your browser's develop tools), go to the "Networking" tab and try to reproduce step with uploading the file.
Click on the line with according request and see details of the response. I hope they can help you.