Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKEditor 4.5 filetools, how to set XHR.withCredentials = true,

Tags:

ckeditor

In CKEditor 4.5 beta, filetools plugin fails to set cookies while using cross domain upload url, for CORS to enable cookies we require to set XHR.withCredentials = true while upload XHR getting initiated.

How can i set XHR properties in filetools plugin in CKEditor 4.5.

like image 233
scb Avatar asked May 05 '15 08:05

scb


1 Answers

You can get access to XHR object by listening to fileUploadRequest event and then you can set withCredentials flag to true.

editor.on( 'fileUploadRequest', function( evt ) {
    var xhr = evt.data.fileLoader.xhr;

    xhr.withCredentials = true;
} );

Working development sample is available here.

like image 113
adelura Avatar answered Oct 11 '22 23:10

adelura