Drag a file from Desktop and Drop into Browser File Element

Discussion in 'Javascript' started by Sirisha, Jun 11, 2008.

  1. Sirisha

    Sirisha Guest

    Hi ...
    Is it possible to drag a file from Client Desktop into the
    Browser Form File Element(input type='file') instead of File Browse?
    I know that, File drag is possible in the Mozilla Firefox
    Browser by adding ADD-ON "DragDropUpload".But I want to implement this
    functionality using the JavaScript/Ajax Code in PHP Application and it
    should be compatible to all the Browsers in PC and iPhone and Windows
    Phone.
    Please, let me know your valuable suggestions and help to solve my
    problem.

    Thanks in Advance,
    Sireesha.
    (PHP Programmer).
     
    Sirisha, Jun 11, 2008
    #1
    1. Advertising

  2. Sirisha <> writes:

    > Hi ...
    > Is it possible to drag a file from Client Desktop into the
    > Browser Form File Element(input type='file') instead of File Browse?
    > I know that, File drag is possible in the Mozilla Firefox
    > Browser by adding ADD-ON "DragDropUpload".But I want to implement this
    > functionality using the JavaScript/Ajax Code in PHP Application and it
    > should be compatible to all the Browsers in PC and iPhone and Windows
    > Phone.
    > Please, let me know your valuable suggestions and help to solve my
    > problem.


    Again: the file element has very limited styling and scripting
    possibilities because of *serious* security implications. In other
    words: drag & drop on a file element is either suppported by whatever
    browser the visitor is using, or not. There is nothing you can do in
    client-side javascript to change that, so don't even try.

    --
    Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
     
    Joost Diepenmaat, Jun 11, 2008
    #2
    1. Advertising

  3. Sirisha

    Guest

    , Jul 8, 2008
    #3
  4. writes:

    > It is can be done.
    > For IE explorer it is easy but code that i found does not work yet.
    > For FireFox the code is worked.
    > See http://straxus.javadevelopersjourna...irefox_drag_and_drop_file_upload_script_p.htm
    >
    > It is not necessarily to get the file. It is necessarily to get the
    > path and then you can got it through Ajax if you want.


    If I read that correctly, you basically have to grant the web page
    permission to read and upload *any* file on your file system. I
    wouldn't grant that permission to any site that I don't control
    myself.

    --
    Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
     
    Joost Diepenmaat, Jul 8, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oliver Klein
    Replies:
    0
    Views:
    705
    Oliver Klein
    Aug 24, 2003
  2. Replies:
    1
    Views:
    438
    Andrew Thompson
    Jan 5, 2005
  3. mr_cross
    Replies:
    11
    Views:
    626
    dorayme
    Oct 11, 2006
  4. Pierre Quentel

    Processing drag & drop on the desktop

    Pierre Quentel, Sep 16, 2007, in forum: Python
    Replies:
    6
    Views:
    492
    Pierre Quentel
    Sep 21, 2007
  5. Replies:
    1
    Views:
    101
    Thomas 'PointedEars' Lahn
    May 28, 2004
Loading...

Share This Page