New issue
Advanced search Search tips

Issue 800630 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 316472
Owner: ----
Closed: Jan 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

DataTransferItem always showing type: image/png when clipboard is a file

Reported by tvpsh2...@gmail.com, Jan 10 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0

Steps to reproduce the problem:
1. Open this link : https://codepen.io/tvpsh2020/pen/KZvpBE
2. Copy any file with any file-extension into clipboard 
3. Paste into the codepen link
4. Any file-extension will show the same file type image/png

What is the expected behavior?
Identifying any file extension correctly

What went wrong?
I'm trying to use DataTransferItem associated API to handle the file copied in my clipboard, first of all I need to recognize the file type, but every file I've copied into the clipboard will be identified as image/png MIME type, am I using the API in wrong method?

Did this work before? N/A 

Does this work in other browsers? No

Chrome version: Version 63.0.3239.132 (Official Build) (64-bit)  Channel: stable
OS Version: OS X 10.13.2
Flash Version:
 
Labels: Needs-Triage-M63
Components: Blink>DataTransfer
Labels: Triaged-ET M-65
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.12.6 using chrome reported version #63.0.3239.132 and latest canary #65.0.3317.0. Issue is not seen in OS-Win and OS-Linux.
This is a non-regression issue as it is observed from M50 old builds. 
Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!

Comment 3 by jsb...@chromium.org, Jan 19 2018

Mergedinto: 316472
Status: Duplicate (was: Untriaged)
Basically the same as issue 316472 - copy/paste of files doesn't give useful results in Chrome.

* On Windows you get nothing (no items)
* On Linux you get one item:
  * kind="string" type="text/plain", which is the full path e.g. "/usr/home/j/file.txt"
* On MacOS you get two items:
  * kind="string" type="text/plain", which is the filename e.g. "file.txt"
  * kind="file" type="image/png" which is provided by the OS; if the OS knows how to decode it then getAsFile() will give you a PNG. If not, getAsFile() yields null.

Per issue 316472 we don't expose pasted files in Chrome; if the OS puts other formats on the clipboard we do pipe that through. So this is MacOS being helpful and populating the clipboard with image data if it can.

So - a duplicate, since we're not doing any special handling of pasted files in Chrome.

Sign in to add a comment