Pratik Shelar Pratik Shelar - 1 year ago 150
jQuery Question

Upload fails when user drags and drops attachement from email client

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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download