buzzy: Phoenix Coyotes primary logo (Coyotes)
[personal profile] buzzy
I was reading the HTML5 specification on drag and drop operations yesterday. I thought that if you could drag files into your browser, why not make it so you can drag links to files out of the browser? Currently, if you drag a link to a file out of the browser into a folder, all you get is a shortcut to the file in the folder. It would be handier to (as the website operator) set some kind of flag so that the user can drag that link to a folder and have it save the file. You can save a displayed image to your hard drive by dragging it into a folder, but a link to an image dragged out of the browser would just give you a shortcut to the image's URL. What if you want to put a link to a ZIP file and have the user drag and drop it to the desired location rather than telling them to right-click the file and click whatever browser-specific menu item to save the link? ("Save Link As..." in Firefox and Chrome or "Save target as..." in IE) There's security implications of having JavaScript and my idea might not work, but I have an idea of how the code for it might look. For example (this is only code demonstrating what I'm talking about...it doesn't work):
<a href="http://www.example.org/downloads/file.ext" rel="dragentirefile" type="audio/ogg" id="some-link">Right-click or drag to save</a>
Of course, the name of the link type (the REL attribute) could be anything. It would be nice if there was a way to use the setDragImage method from the HTML5 DataTransfer interface to set an image to be displayed as the file is being dragged. In my example of an Ogg Vorbis file, the image could be the album cover for whatever song. A text file might show some of the file contents. If a type is specified (in this case, "audio/ogg" for an Ogg Vorbis audio file), but no drag image is specified, the system could pick an appropriate icon for the file drag process. Maybe if the type attribute is set, the browser could figure what was meant by the user dragging the link out of the browser. I was trying to think of ways this could be abused, but it's no less safe than just allowing the user to right-click a link and save the file.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

buzzy: Timon from The Lion King looking sleepy...or maybe sassy. (Default)
Buzzy

May 2020

S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 30th, 2025 02:53 pm
Powered by Dreamwidth Studios