its not clear why you need the div id, the loader just returns the server url of the uploaded file. as this is a 3rd party library you should ask your question on their support:
https://ckeditor.com/docs/ckeditor5/latest/support/index.html
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi! I have 2 CKEditor fields (<div></div>) in the View.
<div id="editor_1">
@Html.Raw(@Model.Description_1)
</div>
<div id="editor_2">
@Html.Raw(@Model.Description_2)
</div>
There is a code that transmits the uploaded image to the controller:
<script>
class MyUploadAdapter {
upload() {
return this.loader.file
.then( file => new Promise( ( resolve, reject ) => {
this._initRequest();
this._initListeners( resolve, reject, file );
this._sendRequest( file );
} ) );
}
_initRequest() {
const xhr = this.xhr = new XMLHttpRequest();
}
}
</script>
How do I pass in _initRequest() a link to the elements <div id="editor_1"> and <div id="editor_2"> to understand which field the user is uploading the image to (I need to get the field id)? I tried to figure it out in the controller (in Request class) where I receive the uploaded image, but I couldn't.
foreach (IFormFile photo in Request.Form.Files)
Thanks!
its not clear why you need the div id, the loader just returns the server url of the uploaded file. as this is a 3rd party library you should ask your question on their support:
https://ckeditor.com/docs/ckeditor5/latest/support/index.html
I solved the problem by myself by getting the focus - in which field the image is uploaded. The issue is closed. https://ckeditor.com/docs/ckeditor5/latest/framework/deep-dive/ui/focus-tracking.html