Help with Netsurf filetypes
John Sandgrounder (1650) 574 posts |
I have some KML files created for !RiscOSM on computer 1 (Ras Pi RISCOS) I would like to view the generated maps on computer 2 (another RISCOS Ras Pi with !RiscOSM) Computer 2 is remote from computer 1 so I can not used shared files, So I am trying to use a WebJames webserver on computer 1 to serv the files to computer 2 running Netsurf. So far, so good, Netsurf does not recognise the filetype and gives me a Download dialogue box to save the file. What I would really like is for Netsurf to recongnise the KML filetype and fire up !RiscOSM on computer 2. Any help would be appreciated. |
John Sandgrounder (1650) 574 posts |
With a bit more thinking, I have a workaround which is not quite as neat, but does work:- A webjames style script on computer 2 which launches a taskwindow which in turn runs wget to fetch the KML file. The webjames script on computer 2 then sets the file type of the file to KML and then filer_runs it. As I said, not quite as neat, so I am still interested in the option for Netsurf to recognise the KML filetype. |
Rick Murray (539) 13406 posts |
Does NetSurf even have the ability to “run” files? For those it cannot deal with itself (like JPEGs etc), the download dialogue will appear. So the file is downloaded, and then you double-click the saved file to run it… The question of whether or not a browser should run a file that it has downloaded is one that could have vociferous arguments in either direction, but in general a browser will not run a file it cannot handle itself (either native, or via some sort of plugin like the Flash/Java/VLC/Silverlight plugins to Firefox) unless the user explicitly says otherwise (either the “Run file” in the save dialogue, or picking the file from the download list – though I believe both only exist because there is no requirement to have any folder viewer active in order to save files, which would make locating them later to be a pain. As RISC OS is usually drag-save, there’s no point in this as the file is right in front of you. Your wget idea is exactly what I would have proposed, if you want to fetch something and then perform a specific action on it. |
Rick Murray (539) 13406 posts |
A better solution was the Fresco “Runnables” file. Maybe such a thing might come to NetSurf one day? |
John Sandgrounder (1650) 574 posts |
Thanks for that. The security factor is not an issue for me as this is only to be available to me on my computers, so it is no less secure than the wget alternative which I will probaly stick with as I now have it working. I gave up on Fresco some time ago: this reason(s) lost in the mist of time. |
Chris Mahoney (1684) 2100 posts |
I think the “proper” way to do this is to serve KML with a MIME type of application/vnd.google-earth.kml+xml (I’m not sure how to do this in WebJames) and then have an entry in your MimeMap file to associate this with the RISC OS file type (which, based on RiscOSM’s !Boot, seems to be D261). That’s how most other file types are set up, so it’s probably sensible to set up KML the same way. 1 The list of file types shows D26 as being a “Premier document”; does anyone know whether KML is registered with ROOL? |
John Sandgrounder (1650) 574 posts |
I think I asked for the “proper” way to do this, so I will have a look at setting it up in Webjames as well as Netsurf). You are right about RiscOSM using file type D26 for KML files. |