The DataTransferItem object represents one drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object.

This interface has no constructor.


DataTransferItem.kind Read only
The kind of drag data item, string or file.
DataTransferItem.type Read only
The drag data item's type, typically a MIME type.


Returns the File object associated with the drag data item (or null if the drag item is not a file).
Invokes the specified callback with the drag data item string as its argument.
Returns an object based on FileSystemEntry representing the selected file's entry in its file system. This will generally be either a FileSystemFileEntry or FileSystemDirectoryEntry object.


All of this interface's methods and properties have their own reference page, and each reference page has an example of its usage.


Specification Status Comment
HTML Living Standard
The definition of 'DataTransferItem' in that specification.
Living Standard Initial definition.
HTML 5.1
The definition of 'DataTransferItem' in that specification.
Recommendation W3C snapshot of WHATWG
File and Directory Entries API
The definition of 'DataTransferItem.webkitGetAsEntry()' in that specification.
Draft Definition of webkitGetAsEntry() as part of the File and Directory Entries API.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support4 Yes50 No12 No
getAsFile4 Yes50 No12 No
getAsString4 Yes50 No12 No
kind4 Yes50 No12 No
type4 Yes50 No12 No
webkitGetAsEntry13 Yes50 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes ?50 No No ?
getAsFile Yes Yes ?50 No No ?
getAsString Yes Yes ?50 No No ?
kind Yes Yes ?50 No No ?
type Yes Yes ?50 No No ?
webkitGetAsEntry No Yes No50 No No ?

Document Tags and Contributors

Contributors to this page: fscholz, erikadoyle, Sheppy, teoli, rolfedh, AFBarstow
Last updated by: fscholz,