Skip to content
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

File browser plugin should allow for setting custom HTTP headers #643

Closed
jswiderski opened this issue Jul 12, 2017 · 2 comments
Closed

File browser plugin should allow for setting custom HTTP headers #643

jswiderski opened this issue Jul 12, 2017 · 2 comments
Labels
plugin:filebrowser The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. target:minor Any docs related issue that can be merged into a master or major branch. type:feature A feature request.
Milestone

Comments

@jswiderski
Copy link
Contributor

jswiderski commented Jul 12, 2017

Are you reporting a feature or a bug?

Feature

Check if the issue is already reported

Provide detailed reproduction steps (if any)

Uploading dropped files allows for creating cross-origin AJAX requests by adding custom HTTP requests.

Unfortunately this is not possible in the File Browser plugin.

This is caused by the File Browser plugin currently using a standard <form> element that is submitted upon clicking the "Send it to the Server" button.

Mouse cursor over the "Send it to the Server" button

Solution

We'll implement an additional upload method for the File Browser plugin that uses XMLHttpRequest through the File Tools plugin.

The new upload method could be enabled using the config.filebrowserUploadMethod property.

The old method using the plain <form> element will still be supported as it is required by old browsers.

For 4.8.x, the <form>element will still be used by default since we cannot make backward incompatible changes in a minor release. Early adopters will already be able to enable it by setting:

config.filebrowserUploadMethod = 'xhr';

The default behavior will be changed in version 4.9.0 (#1365).

Browser Compatibility

All officially supported browsers except Internet Explorer 8 and 9.

The new feature will not be compatible with IE8 and IE9 as there is no Form Data type available there. These browsers will, however, gracefully fall back to the old <form>-based solution. As a result no custom headers will be sent, but the editor will still attempt to upload the file.

Other details

As stated in ticket https://dev.ckeditor.com/ticket/13791, it will probably be easier to create a new plugin then redesign the existing one.

  • Browser: Any
  • OS: Any
  • CKEditor version: 4.0+
  • Installed CKEditor plugins: filebrowser
@jswiderski jswiderski added the type:feature A feature request. label Jul 12, 2017
@mlewand mlewand changed the title Make filebrowser plugin work the same as "Drag&Drop upload" code File browser plugin should allow for setting custom HTTP headers Dec 20, 2017
@mlewand
Copy link
Contributor

mlewand commented Dec 20, 2017

Improved the original report description.

@mlewand mlewand added this to the 4.8.1 milestone Dec 20, 2017
@mlewand mlewand added status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. plugin:filebrowser The plugin which probably causes the issue. target:minor Any docs related issue that can be merged into a master or major branch. labels Dec 20, 2017
@mlewand
Copy link
Contributor

mlewand commented Dec 21, 2017

Note that adding this feature allows us to easily add more features, like upload progress bar. But it's outside of the scope of this issue and should be reported in a separate issue.

@mlewand mlewand added the changelog:api A changelog entry should be put in the API section of the changelog. label Dec 21, 2017
@mlewand mlewand modified the milestones: 4.8.1, 4.9.0 Jan 17, 2018
@mlewand mlewand removed the changelog:api A changelog entry should be put in the API section of the changelog. label Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:filebrowser The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. target:minor Any docs related issue that can be merged into a master or major branch. type:feature A feature request.
Projects
None yet
Development

No branches or pull requests

2 participants