Upload fails when user drags and drops attachment from email client

Pratik Shelar picture Pratik Shelar · Jun 19, 2013 · Viewed 13.6k times · Source

I am using valums fileuploader using jQuery to implement drag and drop functionality in my application. The functionality was running smoothly until one of the users tried the following.

The user received an email with an attachment. He tried to drag and drop the attachment directly from the email client(Outlook) onto the browser and in the drop area. The upload was unsuccessful. But when he saved the file into his filesystem and then drag and dropped the file the upload was successful.

Can anyone let me know what happens in background when the user drags a attachment directly from email? Does it save the file in a temp location? If so then the why does the upload fail?

Answer

Dmitry Streblechenko picture Dmitry Streblechenko · Jun 19, 2013

All browsers are only expecting the actual file drag/drop format (CF_HDROP), but when dragging from Outlook, there is no file on the filesystem. What you get is the CF_FILEDESCRIPTOR and CF_FILECONTENTS formats. No browser that I know of (not even IE), knows how to handle that.