diff --git a/CHANGES.md b/CHANGES.md index 889a107f6e1..49235662df2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,8 @@ New Features: * [#1338](https://github.com/ckeditor/ckeditor-dev/issues/1338): Keystroke labels are displayed for function keys (like F7, F8). -* [#933](https://github.com/ckeditor/ckeditor-dev/issues/933): [File Browser](https://ckeditor.com/cke4/addon/filetools) plugin can now upload files using XHR requests. This allows for setting custom HTTP headers using [`config.fileTools_requestHeaders`](http://docs.ckeditor.test/#!/api/CKEDITOR.config-cfg-fileTools_requestHeaders) configuration option. +* [#933](https://github.com/ckeditor/ckeditor-dev/issues/933): [File Browser](https://ckeditor.com/cke4/addon/filebrowser) plugin can now upload files using XHR requests. This allows for setting custom HTTP headers using [`config.fileTools_requestHeaders`](http://docs.ckeditor.test/#!/api/CKEDITOR.config-cfg-fileTools_requestHeaders) configuration option. +* [#1365](https://github.com/ckeditor/ckeditor-dev/issues/1365): [File Browser](https://ckeditor.com/cke4/addon/filebrowser) plugin uses XHR requests by default. * [#1399](https://github.com/ckeditor/ckeditor-dev/issues/1399): Added possibility to set [`CKEDITOR.config.startupFocus`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-startupFocus) as `start` or `end` to specify where editor focus should be after initialization. * [#1441](https://github.com/ckeditor/ckeditor-dev/issues/1441): [Magic Line](https://ckeditor.com/cke4/addon/magicline) line element can now be identified by `data-cke-magic-line="1"` attribute. diff --git a/plugins/filebrowser/plugin.js b/plugins/filebrowser/plugin.js index bcc4059bc68..93eb7daad17 100644 --- a/plugins/filebrowser/plugin.js +++ b/plugins/filebrowser/plugin.js @@ -311,7 +311,7 @@ if ( uploadFile.call( sender, evt ) ) { // Use one of two upload strategies, either form or XHR based (#643). - if ( editor.config.filebrowserUploadMethod !== 'xhr' || !isFileUploadApiSupported ) { + if ( editor.config.filebrowserUploadMethod === 'form' || !isFileUploadApiSupported ) { // Append token preventing CSRF attacks. appendToken( fileInput ); return true; @@ -604,21 +604,19 @@ * * Available values: * - * * `'xhr'` - XMLHttpRequest is used to upload file. Using this option allows to set up with Additional XHR headers with + * * `'xhr'` - XMLHttpRequest is used to upload file. Using this option allows to set up with additional XHR headers with * {@link CKEDITOR.config#fileTools_requestHeaders} option. - * * `'form'` - (default) File is uploaded by submitting a traditional `
` element. - * * `null` - The default method is used. + * * `'form'` - File is uploaded by submitting a traditional `` element. _Note: That was the only option available until CKEditor 4.9.0._ * * Note: please be aware that `'xhr'` requires the [File Tools](https://ckeditor.com/cke4/addon/filetools) plugin to work * properly. Without the plugin or using a browser that does not support * {@link CKEDITOR.fileTools#isFileUploadSupported file uploading}, will fallback to the `'form'` method despite configuration * option. * - * // Modern browsers will use XMLHttpRequest to upload files. - * // IE8 and IE9 will use form submit even though the config option is set to 'xhr'. - * config.filebrowserUploadMethod = 'xhr'; + * // All browsers will use form element with submit method to upload a file. + * config.filebrowserUploadMethod = 'form'; * * @since 4.9.0 - * @cfg {String/null} [filebrowserUploadMethod=null] + * @cfg {String} [filebrowserUploadMethod='xhr'] * @member CKEDITOR.config */