How to get full file path from drag'n'drop event?

5,881 views
Skip to first unread message

Dmitriy.trt

unread,
Mar 16, 2011, 8:44:32 AM3/16/11
to Chromium-extensions
Is there ANY way to get full file path from drop event? Through
extension, NPAPI plugin, anything. On Linux dropping files to textarea
gives us file:// URL. This is what I want on Windows. How can I get it
with Chrome 9 or 10?

Boris Smus

unread,
Mar 17, 2011, 8:36:33 PM3/17/11
to Dmitriy.trt, Chromium-extensions
Try http://www.html5rocks.com/tutorials/file/dndfiles/#toc-selecting-files-dnd for a good tutorial on dragging in local files.

Hope this helps,
- Boris


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Dmitriy.trt

unread,
Mar 18, 2011, 2:55:54 AM3/18/11
to Chromium-extensions
Unfortunately, this article doesn't help (I don't need to get contents
of file, just full path). I've inspected drop event object contents,
tried to use evt.dataTransfer.getData('text/uri-list'). Seems there is
no way to get it even from extension. Looks like I need another NPAPI
plugin for it. Am I missing something?

On Mar 18, 6:36 am, Boris Smus <s...@chromium.org> wrote:
> Tryhttp://www.html5rocks.com/tutorials/file/dndfiles/#toc-selecting-file...
> a good tutorial on dragging in local files.
>
> Hope this helps,
> - Boris
>
> On Wed, Mar 16, 2011 at 5:44 AM, Dmitriy.trt <dmitriy....@gmail.com> wrote:
> > Is there ANY way to get full file path from drop event? Through
> > extension, NPAPI plugin, anything. On Linux dropping files to textarea
> > gives us file:// URL. This is what I want on Windows. How can I get it
> > with Chrome 9 or 10?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.

Arne Roomann-Kurrik

unread,
Mar 21, 2011, 4:00:40 PM3/21/11
to Dmitriy.trt, Chromium-extensions
Yeah, I don't think there's a way to get this without NPAPI - there's little that a web app would really be able to do with this information.

~Arne


To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

Chacko

unread,
Mar 21, 2011, 5:47:45 PM3/21/11
to kur...@chromium.org, Dmitriy.trt, Chromium-extensions
Dimitriy,

Were you able to get the relative path of a dropped file (relative to the ext folder)?  If yes, I would like to know the api you used to get this.  Thanks.

Arne Roomann-Kurrik

unread,
Mar 21, 2011, 6:03:06 PM3/21/11
to j...@switchbook.com, Chromium-extensions
(+ Public group)

I'm not sure I follow.  The drag and drop action already specifies file contents, so you can upload dropped files.  The full path is pretty irrelevant.

~Arne



On Mon, Mar 21, 2011 at 1:25 PM, j...@switchbook.com <j...@switchbook.com> wrote:
seems an obvious way for a web page to specify a file upload.

--
Joe Andrieu
j...@switchbook.com
+ 1 (805) 705-8651

Sent from my Droid Incredible
Reply all
Reply to author
Forward
0 new messages