Mailing List Archive

Handler for file:// type URLs?
Hi all,

I'm running Mediawiki 1.3.2 on my machine, and wanted to know if there's
any easy way to get file:// type URLs to be supported. I'll probably
start hacking on the source for Parser.php, just wasn't sure if there
was something else I'm missing, first.

thanks,
-Nick
Re: Handler for file:// type URLs? [ In reply to ]
Nick Triantos wrote:
> I'm running Mediawiki 1.3.2 on my machine, and wanted to know if there's
> any easy way to get file:// type URLs to be supported. I'll probably
> start hacking on the source for Parser.php, just wasn't sure if there
> was something else I'm missing, first.

We should probably advertise the FAQ more. :)

Your question is answered right here:
http://meta.wikimedia.org/wiki/MediaWiki_FAQ

-- brion vibber (brion @ pobox.com)
RE: Handler for file:// type URLs? [ In reply to ]
Would I use file:// for excel docs and word docs? And if so, could
someone provide an example of how a link might look? (Code)
I've tried this example and still do not get a working link.

Mike Brierley

-----Original Message-----
From: Brion Vibber [mailto:brion@pobox.com]
Sent: Tuesday, August 31, 2004 1:52 PM
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] Handler for file:// type URLs?

Nick Triantos wrote:
> I'm running Mediawiki 1.3.2 on my machine, and wanted to know if
there's
> any easy way to get file:// type URLs to be supported. I'll probably
> start hacking on the source for Parser.php, just wasn't sure if there
> was something else I'm missing, first.

We should probably advertise the FAQ more. :)

Your question is answered right here:
http://meta.wikimedia.org/wiki/MediaWiki_FAQ

-- brion vibber (brion @ pobox.com)



Email Disclaimer: http://www.co.marin.ca.us/nav/misc/EmailDisclaimer.cfm
Re: Handler for file:// type URLs? [ In reply to ]
On Tue, 7 Sep 2004 15:09:00 -0700, Brierley, Mike
<mbrierley@co.marin.ca.us> wrote:
> Would I use file:// for excel docs and word docs? And if so, could
> someone provide an example of how a link might look? (Code)
> I've tried this example and still do not get a working link.

Your question suggests to me a misunderstanding: the "file:///" (as
opposed to, say "http://") is related to the *location* of the
document, not its type. Be they HTML web-pages, XLS spreadsheets, or
MP3 music tracks, files exist somewhere, and that somewhere is the
target of your link. If the somewhere is on the web, you have a URI
that goes like "http://foo.example.com/bar/baz.quux"; if on your
hard-drive, or on your network, you need to describe it in terms of
the network, and you end up with something like [I think]
"file:///server/folder/subfolder/file.extension". So in wiki-code
(once you've modified the Parser.php, as described at
http://tinyurl.com/4sf3z) you type:

[file:///server/folder/subfolder/file.extension Description of link]

Hope this helps.

--
Rowan Collins BSc
[IMSoP]
Re: Handler for file:// type URLs? [ In reply to ]
Brierley, Mike wrote:
> Would I use file:// for excel docs and word docs? And if so, could
> someone provide an example of how a link might look? (Code)
> I've tried this example and still do not get a working link.

You would use file: URLs to link to any file contained on a local
filesystem or network drive. For instance if your office has Windows
networking, and you want to reference the Excel file
\\bigserver\spreadsheets\stuff.xls you would link like this:

...see file://bigserver/spreadsheets/stuff.xls ...
or
...see [file://bigserver/spreadsheets/stuff.xls the excel file]...

If the server is mapped to a drive letter (say S:) throughout your
network you might do:
...see file://s|/spreadsheets/stuff.xls ...
...see [file://s|/spreadsheets/stuff.xls the excel file] ...

Note that some versions of Mozilla have disabled file: links in pages
retrieved over HTTP for security. I don't know offhand what settings are
necessary to reenable it.

If you just want to link to a file you have uploaded to the wiki, use
media links: [[Media:uploadedfile.xls]]

-- brion vibber (brion @ pobox.com)
RE: Handler for file:// type URLs? [ In reply to ]
Ok two answers that sort of conflict...

Is it file:// or file:///

?

Mike Brierley


-----Original Message-----
From: Brion Vibber [mailto:brion@pobox.com]
Sent: Tuesday, September 07, 2004 3:25 PM
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] Handler for file:// type URLs?

Brierley, Mike wrote:
> Would I use file:// for excel docs and word docs? And if so, could
> someone provide an example of how a link might look? (Code)
> I've tried this example and still do not get a working link.

You would use file: URLs to link to any file contained on a local
filesystem or network drive. For instance if your office has Windows
networking, and you want to reference the Excel file
\\bigserver\spreadsheets\stuff.xls you would link like this:

...see file://bigserver/spreadsheets/stuff.xls ...
or
...see [file://bigserver/spreadsheets/stuff.xls the excel file]...

If the server is mapped to a drive letter (say S:) throughout your
network you might do:
...see file://s|/spreadsheets/stuff.xls ...
...see [file://s|/spreadsheets/stuff.xls the excel file] ...

Note that some versions of Mozilla have disabled file: links in pages
retrieved over HTTP for security. I don't know offhand what settings are

necessary to reenable it.

If you just want to link to a file you have uploaded to the wiki, use
media links: [[Media:uploadedfile.xls]]

-- brion vibber (brion @ pobox.com)



Email Disclaimer: http://www.co.marin.ca.us/nav/misc/EmailDisclaimer.cfm
Re: Handler for file:// type URLs? [ In reply to ]
On Tue, 7 Sep 2004 15:30:25 -0700, Brierley, Mike
<mbrierley@co.marin.ca.us> wrote:
> Ok two answers that sort of conflict...
>
> Is it file:// or file:///
>
> ?

I'm 90% sure it's file:/// - if I only type two /s into mozilla, it
adds the third one for me. Never understood *why* it needs three, but
that just seems to be the way of it.

Otherwise, Brion beats me hands down for clarity and lack of condescension. :-/

--
[IMSoP]
Re: Handler for file:// type URLs? [ In reply to ]
Rowan Collins wrote:
> On Tue, 7 Sep 2004 15:30:25 -0700, Brierley, Mike
> <mbrierley@co.marin.ca.us> wrote:
>>Ok two answers that sort of conflict...
>>
>>Is it file:// or file:///
>>
>>?
>
> I'm 90% sure it's file:/// - if I only type two /s into mozilla, it
> adds the third one for me. Never understood *why* it needs three, but
> that just seems to be the way of it.

It does seem to prefer three. However this is easy to verify
experimentally: try them and see what works.

-- brion vibber (brion @ pobox.com)
Re: Handler for file:// type URLs? [ In reply to ]
Brion Vibber wrote:

> Rowan Collins wrote:
>
>> On Tue, 7 Sep 2004 15:30:25 -0700, Brierley, Mike
>> <mbrierley@co.marin.ca.us> wrote:
>>
>>> Ok two answers that sort of conflict...
>>>
>>> Is it file:// or file:///
>>>
>>> ?
>>
>>
>> I'm 90% sure it's file:/// - if I only type two /s into mozilla, it
>> adds the third one for me. Never understood *why* it needs three, but
>> that just seems to be the way of it.
>
>
> It does seem to prefer three. However this is easy to verify
> experimentally: try them and see what works.
>
> -- brion vibber (brion @ pobox.com)
>
I always thought the base was two slashes (file://, like http://), the
rest was the file path. If you have an absolute file path
starting from the root it begins with /. So now you have 3 slashes in a
row - nothing to do with mozilla, just part of the
logic of it... No?

Graham

>------------------------------------------------------------------------
>
Re: Handler for file:// type URLs? [ In reply to ]
On Wed, 08 Sep 2004 18:34:03 +0100, graham <graham@theseamans.net> wrote:
> Brion Vibber wrote:
>
> > Rowan Collins wrote:
> >
> >> On Tue, 7 Sep 2004 15:30:25 -0700, Brierley, Mike
> >> <mbrierley@co.marin.ca.us> wrote:
> >>
> >>> Ok two answers that sort of conflict...
> >>>
> >>> Is it file:// or file:///
> >>>
> >>> ?
> >>
> >>
> >> I'm 90% sure it's file:/// - if I only type two /s into mozilla, it
> >> adds the third one for me. Never understood *why* it needs three, but
> >> that just seems to be the way of it.
> >
> >
> > It does seem to prefer three. However this is easy to verify
> > experimentally: try them and see what works.
> >
> > -- brion vibber (brion @ pobox.com)
> >
> I always thought the base was two slashes (file://, like http://), the
> rest was the file path. If you have an absolute file path
> starting from the root it begins with /. So now you have 3 slashes in a
> row - nothing to do with mozilla, just part of the
> logic of it... No?
>
> Graham
>

In Windows, it's written (for whatever reason) as
file:///C:/foo/42/file. Though the Unix path name seems to make sense.

-- Jamie
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to GMail!