-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get response from CKEditor Upload #2833
Comments
Hi! I've read through your question but, TBH, I'm not sure whether I understand what you want to achieve. My guess is that you want the What I think you may find useful is the const fileRepo = editor.plugins.get( 'FileRepository' );
const fileLoader = fileRepo.getLoader( yourNativeFileInstance );
fileLoader.on( 'change:uploadResponse', ( evt, name, value, oldValue ) => {
console.log( newValue ); // your data
} ); Does that help? |
@Reinmar Oh, this makes sense. How can i create this File Instance? I don't get this to work :( Thanks for the help! |
I'd need to know more about the feature you want to implement to be able to answer that. Basically, you get files from the paste/drop events – that's what the |
I created a custom adapter to set some headers and upload the images to a custom url. After the upload is complete, i need to get the response and insert them in a array to later use. I only need to broadcast these responses to my parent component. Below is my directive to initialize ckeditor 5
Thanks for your patience 😭 |
Update: There is no need for getting response anymore. I made this in another way on back-end side. Thanks all! |
Great to hear that :) And I think that you could've modified your adapter a bit to not only call It'd be harder if you used one of the existing adapters. I'm 99% sure there would be some other solution but I'd need to think more on it. |
This is the first big issue I've had with ckeditor5. Every time I have had to integrate an editor with uploads I need to listen to the uploaded event to do extra steps. This is the default in every editor I've used. But in this case I need to listen to events on the plugins to be able to get the file instance to listen to events on the loader... |
Got same issue using ckeditor 5. This one made me confused or maybe not really working on ckeditor 5
instead, I figured out the fileLoader is already on the
|
Hi All!
I wanna know if is possible to get the response from my server after the upload is complete.
Currently, i have something like this:
But, all of the four parameters not correspond to the response data.
From a custom adapter, is possible to create a new event to listen, and on this event, return my data?
Thanks!
The text was updated successfully, but these errors were encountered: