Attempting to drop a file into the page and capture information

31 views
Skip to first unread message

Robert Fornal

unread,
Jul 16, 2015, 3:27:21 PM7/16/15
to cefs...@googlegroups.com
I have the following code ...


   
<div class="u-drop-container js-drop-container">
    ...

    $(document).ready(function () {

        $(".js-drop-container").on("drop", function (e) {
            e.stopPropagation()
            e.preventDefault();


            var dt = e.dataTransfer;
            console.log(dt);
        });
    });


I am simply trying to capture the file information when it is dropped onto the page handled by CefSharp (WPF).  Drop is enabled in CefSharp code.

At this point, all that occurs is the "browser" attempts to open the file, rather than passing the information to be handled via JavaScript.

Any ideas on how to handle this would be appreciated.

Bob

Alex Maitland

unread,
Jul 16, 2015, 6:45:33 PM7/16/15
to cefs...@googlegroups.com
If you debug the `CefSharp.Wpf.Example` project, is `OnDragEnter` being called?

https://github.com/cefsharp/CefSharp/blob/cefsharp/41/CefSharp.Wpf/ChromiumWebBrowser.cs#L698
Message has been deleted

Robert Fornal

unread,
Jul 22, 2015, 4:24:00 PM7/22/15
to CefSharp, maitla...@gmail.com
We do have it enabled.  The issue is that a redirect occurs, opening the file.

In the long run, we have a drop element on the HTML page that we'd like to accept the incoming information; in the short run, we want to capture the file name and path and display it on the page.

Bob
Reply all
Reply to author
Forward
0 new messages