Upload image

This example shows the basic setting for uploading images. See the documentation for more details.

Code

<!DOCTYPE html>
<html>
<head>
    <title>Redactor X</title>
    <meta charset="utf-8">

    <!-- css -->
    <link rel="stylesheet" href="/your-dist-path/redactorx.min.css" />
</head>
<body>
    <!-- element -->
    <textarea id="entry">
        <p>Content</p>
    </textarea>

    <!-- js -->
    <script src="/your-dist-path/redactorx.min.js"></script>

    <!-- call -->
    <script>
    RedactorX('#entry', {
        image: {
            upload: '/image-uploader-path/'
        }
    });
    </script>
</body>
</html>

Usage

The editor sends a POST request to the specified path to an uploader on the server. The server-side script should generate a JSON as the response, like this:

{
    "file": {
        "url": "image-url.jpg",
        "id": "some-id"
    }
}