I\'m trying to make it so a user can drag an icon from the web browser to their desktop, and a text file is created. I\'ve got the content part down, but I can\'t figure out how
You can use the .innerHTML
of an element to set the name of linked file
Drag out any of these links to your dekstop
file.txt
where file.txt
is a local file dragged into file manager at *nix os which creates a Link to file.txt
.
plnkr http://plnkr.co/edit/pif0ZraAn9RbJI8w2z0w?p=preview
See also Drag File in Data URI format from Browser to Desktop