feross / feross/drag-drop

How to get the original path of a dragged file

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
482
Forks
60
PR merge metrics
No merged PRs in 30d

Description

When I drag/drop `/Volumes/Drive12/project3/export_8.csv`, the `file.fullPath` = `/export_8.csv`.

You mention this is due to browser security restrictions. However the app I'm building does file management, which requires the complete path (moving files from any place to any other).

There's a [preview-an-image-before-it-is-uploaded](https://stackoverflow.com/a/27165977/864908) thread on stackoverflow that suggests using `URL.createObjectURL()` or `FileReader.readAsDataURL()`, however I don't see how to implement this with drag-drop.

Is there a workaround to retrieve the complete filesystem path of a dragged file?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.