Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag & Drop directly from Outlook in web app [duplicate]

I know this question is relating the same problem as mine :

  • Upload fails when user drags and drops attachment from email client

but I'm looking for a workaround to achieve a drop from Outlook message into my webapp (currently only HTML5 / JS code).

Is it possible, with some activeX, to copy the message in a temp filesystem folder and then use this file reference ? I would like to know the faisability level.

Also, is it right that we can call a DLL from Jscript using ActiveX, like :

var obj = new ActiveXObject("ABCDll.testMethod");
var vResult = obj.TestMethod();
alert(vResult);

BTW, if someone has any other suggestion to do a working Drag&Drop component (IE complient) for ANY files, incl. emails from Outlook (the only things that is not working for now...)

Thanks a lot for any input.

like image 446
Greezer Avatar asked Nov 12 '13 08:11

Greezer


People also ask

What did drag mean?

April 28, 2017. Download PDF: Understanding Drag. Drag is a type of entertainment where people dress up and perform, often in highly stylized ways. The term originated as British theater slang in the 19th century and was used to describe women's clothing worn by men.

Why is it called drag?

This definition probably originated in the theatre of the late 1800s, where male performers wore petticoats to perform as women. Their petticoats would drag on the floor, and so they referred to dressing up as women as “putting on their drags.” By the 1920s, the term “drag” was being used by gay people.

What kind of person is a drag?

The term "drag" refers to the performance of masculinity, femininity or other forms of gender expression. A drag queen is someone (usually male) who performs femininity and a drag king is someone (usually female) who performs masculinity.

What is drag LGBT?

Drag is where individuals dress up as a different gender, primarily for short periods of time, which differentiates the practice from people who are trans and change their gender socially and/or legally.


2 Answers

Outlook uses the CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR formats that many applications do not understand. My solution for this problem uses an Outlook Add-in to intercept the D&D and convert the proprietary format into a usual file drop (CF_HDROP).

The Add-in replaces the DoDragDrop function pointer in the import table of OLE32.DLL with a wrapper function (inside Outlook's memory address space). The wrapper converts the D&D data and calls the original function.

This article describes how to hook into an import table. Outlook's D&D stream format is explained here. The stream data has to be written into (temp) files in order to provide a simple CF_HDROP.

like image 86
wimix Avatar answered Oct 07 '22 23:10

wimix


You can write a browser helper (for IE) in C++ or Delphi that retrieves the current drag/drop handler from IE and installs its own handler. When a message is dragged from Outlook, you can save it to a temp folder, then invoke the original drag/drop handler. After the handler returns, the temporary file can be deleted.

I have done this in the past, and it works fine. You might want to looks at the Google Gears source code (no longer supported) that intercepts drag/drop in IE.

like image 43
Dmitry Streblechenko Avatar answered Oct 08 '22 00:10

Dmitry Streblechenko