Skip to content

Instantly share code, notes, and snippets.

@stefanneculai
Created February 5, 2014 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanneculai/8835056 to your computer and use it in GitHub Desktop.
Save stefanneculai/8835056 to your computer and use it in GitHub Desktop.
Image upload using Froala WYSIWYG editor
$(function() {
$('.selector').editable({
// Set the image upload parameter.
imageUploadParam: 'file_param',
// Set the image upload URL.
imageUploadURL: '/upload_path',
// CORS. Only if needed.
crossDomain: false,
// Set the image error callback.
imageErrorCallback: function (data) {
// Bad link.
if (data.errorCode == 1) {
console.log ('bad link')
}
// No link in upload response.
else if (data.errorCode == 2) {
console.log ('bad response')
}
// Error during file upload.
else if (data.errorCode == 3) {
console.log ('upload error')
}
}
})
});
@savoine
Copy link

savoine commented Nov 3, 2014

Managed to create an upload with java for froala?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment