Problem loading image on CKEditor


I am using ckeditor 4.11 and the problem is that you do not want to upload an image, it sends me a message that says "Incorrect server response".

This is what I have code:


<form action="" method="post">
<textarea name="editor" id="editor">
<input type="button" value="Subir" name="boton" onClick="agregar();">
var editor = CKEDITOR.replace('editor');

In the config.js file of the ckeditor:

config.filebrowserUploadUrl = 'upload.php';


$basePath = "imagenes/";

$baseUrl = "imagenes/";

$CKEditor = $_GET['CKEditor'] ;

$funcNum = $_GET['CKEditorFuncNum'] ;

$langCode = $_GET['langCode'] ;

$url = '' ;

$message = '';

if (isset($_FILES['upload'])) {

    $name = $_FILES['upload']['name'];

    move_uploaded_file($_FILES["upload"]["tmp_name"], $basePath . $name);

    $url = $baseUrl . $name ;
    $message = 'No file has been sent';

echo "<script type='text/javascript'>$funcNum, '$url', '$message')</script>";

I upload the file upload.php to the same location where I have the index.php file.

In another older version that I have of ckeditor I have no problems but the issue is that this version is not compatible with the video plugin and that's why I had to change the version.

asked by Jorge Alonso 13.12.2018 в 16:31

0 answers