Drag a file from Desktop and Drop into Browser File Element

S

Sirisha

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).
 
J

Joost Diepenmaat

Sirisha said:
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.
 
J

Joost Diepenmaat

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top