Opened 7 years ago

Last modified 7 years ago

#16908 assigned Task

It's not possible to paste file on Chrome on Mac

Reported by: Piotr Jasiun Owned by: beata_delura
Priority: Must have (possibly next milestone) Milestone:
Component: General Version: 4.5.0 Beta
Keywords: Cc:

Description

And it could be possible.

What Chrome gives, when I paste a file is DataTransfer (a.k.a. ClipboardData) object with an empty "files" property, but with 2 "items": first with a filename and the second with a file. It means it is possible to get a file from the second "item", on paste.

Unfortunately, when the upload plugin was implemented there was only one item on Chrome and only the first item is handled (see https://github.com/ckeditor/ckeditor-dev/blob/685fc7474fab779afe76edcf36011d2fb6bafab8/plugins/clipboard/plugin.js#L2545). If this line will be replaced with a loop it should be possible to get the file.

Note that on Windows pasted file is not available at all.

Also, note that now you do not need try-catch block there since items have a "kind" property which let you check if it is a file or a string.

Change History (4)

comment:1 Changed 7 years ago by Jakub Ś

Status: newconfirmed

comment:2 Changed 7 years ago by beata_delura

Owner: set to beata_delura
Status: confirmedassigned

comment:3 Changed 7 years ago by beata_delura

Status: assignedreview

comment:4 Changed 7 years ago by beata_delura

Status: reviewassigned
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy