Drag and drop for file uploads

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Drag and drop for file uploads

Postby Czarek » Wed Dec 07, 2016 2:47 pm

I've tested drag and drop file upload in cefclient using this example and it doesn't work. I guess Issue #601 is to implement this. Wondering if I could accomplish similar functionality using CefDragHandler::OnDragEnter with CefDragData::GetFileNames. There wouldn't be an indicator that file is being dragged onto region, it would only allow for dragging file onto whole web view. Two questions:

1. Does CefDragData::GetFileNames return real paths to files being dragged into the browser window?
2. With some bridge between c++<>js is it possible for it to work for file uploads?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Drag and drop for file uploads

Postby magreenblatt » Thu Dec 08, 2016 4:45 am

What OS and CEF version? What specifically doesn't work? If you're testing in cefclient did you remove the check in ClientHandler::OnDragEnter? https://bitbucket.org/chromiumembedded/ ... ler.cc-448
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Drag and drop for file uploads

Postby Czarek » Thu Dec 08, 2016 5:08 am

magreenblatt wrote:What OS and CEF version?

Ubuntu 14.04 and cef_3.2883.1506.ga6c42a7 (a month old).

magreenblatt wrote:What specifically doesn't work?

Dragging file onto the file upload region doesn't work. It works in Chrome. In cefclient/cefsimple when dragging file onto window, mouse cursor indicates that drag is not allowed.

magreenblatt wrote:If you're testing in cefclient did you remove the check in ClientHandler::OnDragEnter? https://bitbucket.org/chromiumembedded/ ... ler.cc-448

I didn't remove this check in cefclient, however I've tested in cefsimple which doesn't have OnDragEnter, which means it should allow dragging by default. But it also doesn't work in cefsimple.
Last edited by Czarek on Thu Dec 08, 2016 11:07 am, edited 1 time in total.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Drag and drop for file uploads

Postby Czarek » Thu Dec 08, 2016 11:03 am

Tested latest 2883 on Windows and css-tricks example works OK. Tested both cefsimple and cefclient with OnDragEnter code commented out.

So looks like this is Linux only issue.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Drag and drop for file uploads

Postby magreenblatt » Thu Dec 08, 2016 11:05 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Drag and drop for file uploads

Postby Czarek » Thu Dec 08, 2016 2:06 pm


Thanks.

Btw. search on bitbucket is poor, if I search for drag drop it doesn't find anything. Looks like it can search only whole sentences.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 72 guests