Filemanager

Manage, upload, select files and place them anywhere in Redactor.

    Demo

    Code

    <!DOCTYPE html>
    <html>
        <head>
            <title>Redactor</title>
            <meta charset="utf-8">
    
            <!-- redactor css -->
            <link rel="stylesheet" href="/your-folder/redactor.css" />
    
            <!-- plugin css -->
            <link rel="stylesheet" href="/your-folder/plugins/filemanager.css" />
        </head>
        <body>
            <!-- element -->
            <textarea id="content">...</textarea>
    
            <!-- redactor js -->
            <script src="/your-folder/redactor.js"></script>
    
            <!-- plugin js -->
            <script src="/your-folder/plugins/filemanager.js"></script>
    
            <!-- call -->
            <script>
            $R('#content', {
                plugins: ['filemanager'],
                fileUpload: '/your-upload-script/',
                fileManagerJson: '/your-folder/files.json'
            });
            </script>
        </body>
    </html>

    Usage

    files.json example

    [
        {
            "title": "File 1",
            "name": "1.txt",
            "url": "/file-url/1.txt",
            "id": 1, "size": "301Kb"
        },
        {
            "title": "File 2",
            "name": "2.txt",
            "url": "/file-url/2.txt",
            "id": 2,
            "size": "1MB"
        }
    ]