Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The getAsFileSystemHandle() method of the DataTransferItem interface returns a Promise that fulfills with a FileSystemFileHandle if the dragged item is a file, or fulfills with a FileSystemDirectoryHandle if the dragged item is a directory.
None.
A Promise.
If the item's kind property is "file", and this item is accessed in the dragstart or drop event handlers, then the returned promise is fulfilled with a FileSystemFileHandle if the dragged item is a file or a FileSystemDirectoryHandle if the dragged item is a directory.
Otherwise, the promise fulfills with null.
None.
This example uses the getAsFileSystemHandle() method to return file handles for dropped items.
Note: Because getAsFileSystemHandle() can only retrieve the entry handle in the same tick as the drop event handler, there must be no await before it. This is why we synchronously invoke getAsFileSystemHandle() for all items first, and then wait for their results concurrently.
| File System Access # dom-datatransferitem-getasfilesystemhandle |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 30, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.