Very simple HTML5 drag and drop
Posted: Tue Jan 24, 2012 7:13 am
I need to be able to drop the filename of an image from one browser window to a form text input in a different window.
The files are already on the web server and the process will only be done by browsers supporting html5.
The only problem I have is that when I drag an image to the input box, it inserts the whole url, and I only want the filename to be inserted. In other words, it inserts http://www.path/path/file.jpg, but I just want to end up with file.jpg.
I believe the solution involves the file object .name property, but I don't know how to implement this.
Any help appreciated.
The files are already on the web server and the process will only be done by browsers supporting html5.
The only problem I have is that when I drag an image to the input box, it inserts the whole url, and I only want the filename to be inserted. In other words, it inserts http://www.path/path/file.jpg, but I just want to end up with file.jpg.
I believe the solution involves the file object .name property, but I don't know how to implement this.
Any help appreciated.