In Windows, when I was posting an image, I could just post the link with the browse dialog, by putting a url in the location bar. How can I achive the same functionality in Ubuntu with nautilus?

For example, to insert this image to (say) facebook, I could enter the URL as I browse:

enter image description here

enter image description here

And click Open. But on Ubuntu nothing happens.

  • Where exactly do you want to post the image? – s3lph Dec 4 '14 at 21:56
  • Just to clarify: Am I right in assuming that you're dealing with Firefox? – Kalle Elmér Dec 4 '14 at 21:56
  • This drag and drop behavior is rather website dependent than OS dependent. Using Chrome, I can easily drag and drop images on github. – s3lph Dec 5 '14 at 22:42
  • @the_Seppi: Anywhere when there's a "select image..." button. Instead of, say, ~/images/pic.jpg, i just paste "webpage.com/pic.jpg" on the adress bar of the choose file window. Am i explaining correctly? – Takoinche Dec 5 '14 at 22:45
  • 2
    @the_Seppi nope, that's exactly my problem. You can actually do that in Windows and it saves you one step in saving the image by posting it directly. – Takoinche Dec 6 '14 at 23:36

This seems to be a limitation of the GTK+. You can't force its file selector to do something it just can't currently do. Any applications that use the GTK+ file selector widget are going to have the same problems.

However applications that use the Qt equivalent (and therefore all KDE applications and many others), can open directly from HTTP links. I have tested this in Kate.

I'm not sure what solution you want here. You could probably spend some time hacking this into the relevant GTK library so that it functions like this in the future. You could then submit that upstream and it'd eventually be the default (if accepted).

But the quicker route for this is either:

  • Using an application that uses QT (or another framework that does this)
  • Find another workflow.

In the context a browser, no browsers that I have tested (including GTK and Qt widget based ones) were capable of opening a remote URI for a file selection.

As mentioned earlier, Qt is technically capable of this but in Rekonq (the Qt browser I tested) it seemed limited to local files only. This may be something that could be worked on. For the GTK+ browsers (most of them) work needs to be done at on GTK before they'll work.

In short, fixing this in the browser isn't going to be practical for anybody.

That said you might be able to create a FUSE-based filesystem that read from the clipboard and provided a fake filesystem that contained one file (which then streamed data from the URL using something like the python-requests library).

You could then just select that file in the browser and it'd work like any other file.

This isn't a small project (hence the lack of code) but it would be quite achievable to somebody with a little bit of Python experience.

  • I was looking for a way to upload images using http URL or a confirmation that it is indeed not possible to upload images using http URL. Idea of hacking into GTK library and checking in relevant code looks great but I am not a programmer. So QT equivalent could be an option for me. Thanks! – Chethan S. Jan 16 '15 at 10:58
  • 1
    I see what you're suggesting. I've just tried rekonq (a QT based browser) but it's a no-go there too. – Oli Jan 16 '15 at 11:10
  • It turns out that even Mac users are on the same boat discussions.apple.com/thread/6109624 – Chethan S. Jan 18 '15 at 14:45
  • 1
    @ChethanS. I've thought of an actual solution but it'll take a little bit of work to be usable. You could make a FUSE filesystem that read URLs from the clipboard and made fake files seem available. You could mount that on somewhere like /clipboard and the select the applicable file from any standard file selector widget. – Oli Jan 20 '15 at 15:48
  • that seems interesting. I will work towards finding how to achieve that. Meantime if you find a tutorial somewhere please share it here. I am also awarding the bounty to your answer! – Chethan S. Jan 21 '15 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.