And an obligatory command-line solution :) In the spirit of this answer: What is the command line equivalent of copying a file to clipboard? I wrote a simple Python script which accepts an URL to a resource as a parameter, downloads the file/page to a temporary location and copies the full file name to the clipboard. All that is left is to open Open File dialog and press Ctrl-V.
The script:
#!/usr/bin/python2
import os, tempfile, argparse, urllib
parser = argparse.ArgumentParser(description="Download a file from an URL, save it as a temporary file and copy a link to the file to clipboard")
parser.add_argument("url", help="The URL of a file to download")
args = parser.parse_args()
filename = tempfile.mktemp()
urllib.urlretrieve(args.url, filename)
os.system("echo %s|xclip -i -selection clipboard" % filename)
print("File %s has been copied to clipboard, now open a File dialog and press Ctrl-V." % filename)
To use, create a directory called bin
in your home directory, put the script there (I named it gimme
) and set executable permission on it:
chmod +x ~/bin/gimme
Ahh, and you'll need xclip
for it to work:
sudo apt-get install xclip
And here's how to use it:
gimme https://askubuntu.com/questions/228667/upload-file-from-url
File /tmp/tmpFXs7_S has been copied to clipboard, now open a File dialog and press Ctrl-V.