Documentation
Upload
upload.before.send #
xhr | Object | XMLHttpRequest object. |
data | Object | FromData object. |
files | Array | Array of sending files. |
e | Object | Event object. |
Occurs before sending the upload request to the server.
This event has event.stop
method.
ArticleEditor('#entry', {
css: '/your-article-dist-path/',
subscribe: {
'upload.before.send': function(event) {
var xhr = event.get('xhr');
xhr.setRequestHeader('X-CSRF-Token', 'your-token-value');
}
}
});
upload.complete #
response | Object | JSON response |
Occurs when the upload complete.
ArticleEditor('#entry', {
css: '/your-article-dist-path/',
subscribe: {
'upload.complete': function(event) {
...
}
}
});
upload.error #
response | Object | JSON response |
Occurs when the autosave request fails.
ArticleEditor('#entry', {
css: '/your-article-dist-path/',
subscribe: {
'upload.error': function(event) {
...
}
}
});
Here is the example of JSON error response:
{
"error": true,
"message": "Something went wrong..."
}