Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

v2.x Server response

Galymzhan Abdugalimov edited this page Feb 23, 2017 · 2 revisions

The insert plugin is using blueimp's jquery-file-upload plugin for uploading images. After uploading any image to a server, it should send JSON response to a client with URI of the uploaded image.

In brief, response from the server after uploading any image should have a minimal structure that looks like this:

{ 
  "files":
    [
      {
        "url": "http://url.to/image/"
      }
    ]
}

For more details, read wiki of the jquery-file-upload plugin.

One last thing: Make sure your server returns an absolute path. A preview image (base64) is replaced by a path to an uploaded image only if a browser successfully loads the uploaded image first. If the image couldn't be loaded, the preview image is never replaced.