Drag and drop from Outlook to web app

0 Answers 838 Views
General Discussions
Bermuda
Top achievements
Rank 1
Iron
Iron
Bermuda asked on 28 Mar 2023, 03:28 PM

Hello,

We have a requirement to attach emails to records for audit purposes.  Is this possible with your controls?

Regards,

D

Rumen
Telerik team
commented on 29 Mar 2023, 09:18 AM

You can drag and drop Outlook emails on the page and upload them with the help of RadAsyncUpload.

Please refer to this FR item ADD: ability to Drag and drop files and messages directly from OutLook to RadAsyncUpload and especially to the summary provided by Peter Milchev:

Nevertheless, you might see this "working" in new versions of Google Chrome and the new Edge. This is due to some commits that Microsoft made to the Chromium core, which will be used in the new Chromium-based Edge browser.

https://www.windowslatest.com/2019/02/28/drag-and-drop-support-to-chrome-for-attachments-from-outlook/;

The glitch with this implementation is that the dragged message will be uploaded properly in the browser but it will be moved to the Deleted folder in Outlook.

As per Amish's reply, you can see that a possible workaround for the "delete" issue is the dropEffect to be set to "copy" in the dropover event:

https://answers.microsoft.com/en-us/msoffice/forum/all/drag-and-drop-works-however-deletes-email-can-we/865f60c3-7980-4465-8a19-4d60b0ae5aba 

https://www.telerik.com/forums/paste-files-into-radupload-dropzone#-joHU82nXUysw0gggoszQw 

 

<script>
    // apply to all RadAsyncUpload controls on the page
    function pageLoadHandler() {
        $telerik.$(".RadAsyncUpload").each(function (ind, el) {
            var au = el.control;
            if (au.get_loadedModuleName().toLowerCase() == "file api") {
                au._uploadModule._dropoverHandler = function (ev) {
                    var dt = ev.originalEvent.dataTransfer;
                    dt.dropEffect = "copy";
                    // we need to call prevent default, otherwise
                    // the browser will try to open the document (by default)
                    ev.preventDefault();
                    ev.stopPropagation();
                }

            }
        })

        // Sys.Application.remove_load(pageLoadHandler);  
    }
    Sys.Application.add_load(pageLoadHandler);
</script>
<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1"></telerik:RadAsyncUpload>

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Bermuda
Top achievements
Rank 1
Iron
Iron
Share this question
or