Froala $响应变量

I have read the documentation of Froala editor: http://editor.froala.com/server-integrations/php-image-upload

Have read through articles about same issue here in stack overflow, however no success yet. Problem is with $response variable which puts image path in image src parameter. So far froala is putting image in specified folder on server(so script works).Problem is froala is not putting path in image source that way image is not added.

This is my image upload script (works perfectly fine)

<?php
$fileName = $_FILES["image"]["name"];
$fileTmpLoc = $_FILES["image"]["tmp_name"];
$fileType = $_FILES["image"]["type"];
$fileSize = $_FILES["image"]["size"]; 
$fileErrorMsg = $_FILES["image"]["error"]; 
$kaboom = explode(".", $fileName); 
$fileExt = end($kaboom);
$fileName = time().rand().".".$fileExt;
if (!$fileTmpLoc) { 
 header('Location: ../announcments.php?aid=9');
     exit();
} else if($fileSize > 5242880) { 
    echo "ERROR: Your file was larger than 5 Megabytes in size.";
    unlink($fileTmpLoc); 
    exit();
} else if (!preg_match("/.(gif|jpg|png|JPG)$/i", $fileName) ) {
     echo "ERROR: Your image was not .gif, .jpg, or .png.";
     unlink($fileTmpLoc); 
     exit();
} else if ($fileErrorMsg == 1) { 
    echo "ERROR: An error occured while processing the file. Try again.";
    exit();
}
$moveResult = move_uploaded_file($fileTmpLoc, "../uploads/contentimg/$fileName");
if ($moveResult != true) {
    echo "ERROR: File not uploaded. Try again.";
    unlink($fileTmpLoc); 

    //This bit has been taken as example from froala website. 
    // Generate response.
        $response = new StdClass;
        $response->link = "/uploads/contentimg/" . $fileName;
        echo stripslashes(json_encode($response));
        //example from froala ends
    exit();
}

So this must be wrong as everything else works:

// Generate response.
            $response = new StdClass;
            $response->link = "/uploads/contentimg/" . $fileName;
            echo stripslashes(json_encode($response));

Please help.

When the image is saved, a POST request is made. The response will be something like this: {link: '/uploads/contentimg/file_name.jpg'}. You have to make sure that the response link can be accessed in the browser as an absolute path in your case. If you are on http://example.com/my/long/path, the image will be accessed on http://example.com/uploads/contentimg/file_name.jpg.