drag n drop desktop file to application as such in google

Is that possible to " Drag n drop file from desktop to
upload " in Ruby on rails application

       for example : google (gmail) drag n drop attachments same as
this feature .

        Drag and drop functionality working but how to upload the
file to the application ? through
ajax ? or other functionaltiy ?

         how to get file object through javascript which attributes
suits for that ?

         how to implement this ?..........

        Any ideas greatly appreciated .....