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

[Edge] Support for uploading images with base64 source #5173

Closed
f1ames opened this issue Nov 14, 2018 · 3 comments
Closed

[Edge] Support for uploading images with base64 source #5173

f1ames opened this issue Nov 14, 2018 · 3 comments
Labels
package:image type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@f1ames
Copy link
Contributor

f1ames commented Nov 14, 2018

This is a follow up #5172.

Since the File API is used during image base64 to file conversion, it doesn't work on Edge as File constructor is not supported there (see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9551546/).

Alternatively the Blob object could be used, however blobs itself do not provide a way to define a filename. This is problematic since during upload the filename is read from the file object and send with other data:

image

and with Blob instance, the filename is always set to "blob":

image

which doesn't work well with upload integration:

  • File with the same name is always send to the server.
  • File name doesn't have the extension so checking file type by extension fails.

We need to figure out a way to provide custom filename so it can be send with upload request. It may be done by adjusting blob object so the browser uses custom name which was added (not 100% sure, my initial tests failed here). The second option is to pass filename to a loader so it is used further in the uploading process (added to formData object).

@f1ames
Copy link
Contributor Author

f1ames commented Dec 3, 2018

During development of the main feature (#246), we have decided that all uploaded images will have image.ext name, which means that server-side implementation of the file uploading should take care of proper naming.
The only problem with Edge is that files are uploaded with blob filename - but apart from that Blob's can be uploaded the same way as File's. So maybe if we had assumed that server-side code takes care of naming, we could upload the blob files in Edge (which seems to be better solution than just removing images from pasted content) and add a proper documentation for this case for handling blob named files. WDYT? cc @Reinmar

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-image Oct 9, 2019
@mlewand mlewand added this to the backlog milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:improvement This issue reports a possible enhancement of an existing feature. package:image labels Oct 9, 2019
@tomalec
Copy link
Contributor

tomalec commented Apr 20, 2020

Seems the issue is solved by Edge switching to Chromium. I run automated tests and a few manual ones. Checked http://localhost:8125/ckeditor5-image/tests/manual/imageupload.html precisely.

So, from a newbie perspective seems, as solved.

@tomalec
Copy link
Contributor

tomalec commented Apr 20, 2020

Closing as no longer a problem.

@tomalec tomalec closed this as completed Apr 20, 2020
@tomalec tomalec removed this from the backlog milestone Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

3 participants