5

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:

flow diagram

open files dialog

And click Open. But on Ubuntu nothing happens.

Zanna
  • 69,223
  • 56
  • 216
  • 327
Takoinche
  • 59
  • 3
  • Where exactly do you want to post the image? – s3lph Dec 04 '14 at 21:56
  • Just to clarify: Am I right in assuming that you're dealing with Firefox? – Kalle Elmér Dec 04 '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 05 '14 at 22:42
  • @the_Seppi: Anywhere when there's a "select image..." button. Instead of, say, ~/images/pic.jpg, i just paste "http://webpage.com/pic.jpg" on the adress bar of the choose file window. Am i explaining correctly? – Takoinche Dec 05 '14 at 22:45
  • @KalleElmér: Nay, Chrome. But it should work on every browser. – Takoinche Dec 05 '14 at 22:46
  • So you're talking about the open file dialog? That's handled by Nautilus. Try pasting http:// in front of the bar. – s3lph Dec 06 '14 at 16:07
  • 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 06 '14 at 23:36
  • That functionality seems doesn't exist in Nautilus' open file dialog. – Wolverine Jan 14 '15 at 16:43
  • If you're running Kubuntu (or have the necessary KDE files) then you could install firefox-kde, https://www.kubuntuforums.net/showthread.php?62515-Firefox-KDE-Integration-Kubuntu-13-04, and use the KDE file dialog which allows pasting in an URL in place of a file path in the file dialog. But that's not "with nautilus" of course. – pbhj Jan 19 '15 at 14:48

1 Answers1

5

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.

Oli
  • 289,791
  • 117
  • 680
  • 835
  • 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 https://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 04:22