Drag and Drop files into a SharePoint webpart to upload into DocLibrary

Nick Haslam picture Nick Haslam · Mar 30, 2009 · Viewed 8.7k times · Source

Is it possible to create a SharePoint (wss3 or MOSS 2007) webpart, to allow files to be dragged and dropped onto it, which would then upload the files into a predefined document library ?

I imagine that this would require some form of client side scripting (Ajax ?), but my knowledge in ajax is a bit sketchy.

From my exploration so far, I'm thinking:

  1. User drags file onto 'drop zone' Webpart.
  2. This action triggers some code
  3. This code Loads the file into a SharePoint library (like this : Uploading a File to SharePoint)

Any pointers would be gratefully recieved

Many thanks.

Nick

Answer

jaloplo picture jaloplo · Mar 30, 2009

Well,

What I'd do is, like you said, a web part with javascript that allow the user to drag and drop some files into a zone inside the webpart. Once the user has finished I'll upload those files after click on a Button of the webpart. I think is better to work with SharePoint in an unique transaction and not upload and delete files using AJAX. So, the drag and drop functionality can be done using some kind of javascript like Scriptaculous and the other one like a classic postback.