function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vishal gupta 47vishal gupta 47 

Drag and drop multi-upload functionality for attachments/files?

How to Drag and drop multi-upload functionality for attachments/files in salesforce.
Best Answer chosen by vishal gupta 47
NagendraNagendra (Salesforce Developers) 
Hi Vishal,

It's pretty difficult, as you need to be able to base64encode the file before it's sent to the server (this can accomplish in some browsers Firefox, Chrome, Safari? Probably not IE.)

Also, to get VisualForce to properly encode the 'form-data' that is being submitted to the server you need to create a VF form that points directly to a 'File Input' field, which is hard to link to a drag and drop functionality.

So I recommend doing something like:
<iframe src="myvfpage_with_file_input_form" style="display:none; />
And have your parent page fill in and submit the form on the hidden vf page in the form when the drag and drop takes place.
I like Uploadify for drag & drop, it uses Flash/Javascript (free version) and/or HTML5/Javascript (in the paid version).

Please mark this as best answer if it helps.

Best Regards,
Nagendra.P