0

I need to implement dragging outlook attachment to web browser, when dropped, I should get some file info, I tried using pure javascript, but not working, Now I have no idea,

thanks

0m3r
  • 12,286
  • 15
  • 35
  • 71
pig.li
  • 49
  • 4

1 Answers1

0

You cannot do that directly. See Upload fails when user drags and drops attachment from email client

Saving attachment to the file system is pretty much the only workaround.

Community
  • 1
  • 1
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • yeah, but I have to, so do you have any other workaround? like java applet or local application? – pig.li Jun 26 '15 at 05:47
  • You can inject your own dll into the browser process space (shell hook?) that will replace the IDropTarget interface on the native browse HWND with your own implementation. When you get the CF_FILEDESCRIPTOR and CF_FILECONTENTS drop, you can convert the data into a file in a temporary folder and pass CF_HDROP to the original drop handler. I tried that and it works, but it is a part of a commercial product, so I can't share any details of its implementation, sorry. – Dmitry Streblechenko Jun 26 '15 at 06:08
  • Got that, thanks. And I'm a web front-end developer, so where should I start or any pages recommend? – pig.li Jun 26 '15 at 07:14
  • This is as low level as it gets. I don't think anything but C++ or Delphi would do. – Dmitry Streblechenko Jun 26 '15 at 16:55
  • Another question, so you know Microsoft.Office.Interop.Outlook.dll? could I use it in my app to achieve dragging outlook attachments to some local app? Thanks very much. – pig.li Jul 15 '15 at 03:53
  • No, Interop dll is nothing but a glorified binary header file. You can use JavaScript in IE to access Outlook Object Model objects, but that won't help you with drag and drop. – Dmitry Streblechenko Jul 15 '15 at 05:08
  • Is that mean there are no drag and drop events in the Outlook object model? – pig.li Jul 16 '15 at 03:04
  • Nope, Neither when you drag out nor when you drag in. Even if there were such events, you could have used them in IE only when running as a trusted site. – Dmitry Streblechenko Jul 16 '15 at 04:49
  • Another question is, is there any way could get the drag event or convert outlook drag format? like using outlook addin, capture drag event or when user open email item, convert attachment format? – pig.li Aug 03 '15 at 10:06
  • No, there is no such event. – Dmitry Streblechenko Aug 03 '15 at 13:19
  • http://stackoverflow.com/questions/19924528/drag-drop-directly-from-outlook-in-web-app/31094424#31094424 – Angad Sep 22 '15 at 23:22