• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can JavaScript detect a file dragged from desktop?

 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible for some JavaScript code in a browser to be able to receive a "drop" of a file from the desktop? If I drag in an html file to most browsers, the browser will display that html file. On IE on my Mac, if I drag in a non-html file, it tries to launch the right "helper" app, ie, if I drag in a .txt file, it will launch TextEdit.
But, say I want to drag in an arbitrary file from the desktop, and get info about that file so I can send it to an applet...is there a way to do that with JavaScript? Some kind of event monitor looking for drag&drop events?
If I were writing a Java 2 applet I could use the drag&drop libraries but unfortunately I have to support the older JVM so I can't use those. As far as I can tell I can't implement drag-from-the-desktop in java 1.1, so I'm looking around for alternatives, and thought maybe JavaScript could help.
Thanks!
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To the best of my memory you can not do it with javascript. There may be an active -x control that you can do it with, but I am not sure. That would be handy for file uploads......
Eric
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic