Hi,
I'm currently working on deploying a mediawiki installation (IIS/W2K3/MySQL5, if it matters) for the company I work for. I've got everything pretty much done, and people are using the wiki already with positive reviews. The problem I'm having at the moment is with file storage. We don't want to upload all the files, as some files need to change regularly and be stored on a network drive.
I've gotten far enough with this using meta and mediawiki.org, and have enabled file:// links and a bunch of other stuff to make this posisble, even changing the browsers so file:// links are supported from the site. The only problem I've got left is what to do when there's a space in the file or directory name being linked to.
For example, if a file is stored in p:\docs\some user documentation.doc, I can't link to it in the wiki without setting $wgRawHtml and using the a href=... tag directly inside html tags. Not a very secure option, and also not very user-friendly. Substituting spaces for %20 doesn't work (IE renders the %20 directly for file:// links, it seems), and using [blah] doesn't work, becuase the first space gets regarded as the split between the url and the title of the link to be displayed. And an a href tag just gets ignored, despite my efforts to try and add it to the attribute whitelist.
I've been messing around for options for a few days now, and I've broken and unbroken everything a few times, by screwing with stuff like Sanitize.php, Linker.php, Parser.php, and so on. But despite being a long-term PHP developer, I can't figure this code out despite my best efforts.
So I'd like to ask the community if they have any suggestions on how I can achieve this? None of the code changes I made seemed to have any effect, so I'm at a loss as to what to do next.
Thanks everyone for your time and any assistance you can offer.
Cheers, Michael.
Michael . wrote:
For example, if a file is stored in p:\docs\some user documentation.doc, I can't link to it in the wiki without setting $wgRawHtml and using the a href=... tag directly inside html tags. Not a very secure option, and also not very user-friendly. Substituting spaces for %20 doesn't work (IE renders the %20 directly for file:// links, it seems), and using [blah] doesn't work, becuase the first space gets regarded as the split between the url and the title of the link to be displayed. And an a href tag just gets ignored, despite my efforts to try and add it to the attribute whitelist.
%20 works for me in IE 7. That would be the standard solution. You need to use file:/// not file:// for local links for this to work in IE. Three slashes are required to comply with RFC 1738 anyway.
-- Tim Starling
Michael . wrote: [...]
I've gotten far enough with this using meta and mediawiki.org, and have enabled file:// links and a bunch of other stuff to make this posisble, even changing the browsers so file:// links are supported from the site. The only problem I've got left is what to do when there's a space in the file or directory name being linked to.
For example, if a file is stored in p:\docs\some user documentation.doc, I can't link to it in the wiki without setting $wgRawHtml and using the a href=... tag directly inside html tags. Not a very secure option, and also not very user-friendly. Substituting spaces for %20 doesn't work (IE renders the %20 directly for file:// links, it seems), and using [blah] doesn't work, becuase the first space gets regarded as the split between the url and the title of the link to be displayed. And an a href tag just gets ignored, despite my efforts to try and add it to the attribute whitelist.
I've been messing around for options for a few days now, and I've broken and unbroken everything a few times, by screwing with stuff like Sanitize.php, Linker.php, Parser.php, and so on. But despite being a long-term PHP developer, I can't figure this code out despite my best efforts.
So I'd like to ask the community if they have any suggestions on how I can achieve this? None of the code changes I made seemed to have any effect, so I'm at a loss as to what to do next.
Maybe you can create a simple markup extension, which transforms something like '<mylink href="file://p:\docs\a b c">Link</mylink>' into '<a href="file://p:\docs\a b c">Link</a>' (or what the correct HTML should be).
These extensions are very easy to build. The documentation is here: http://meta.wikimedia.org/wiki/Extending_wiki_markup
Good luck.
Not a proper solution, but being a windows machine, you could use the DOS name: c:\docume~1\username\mydocu~1\file.doc
Hi,
I just wanted to quickly say a big thanks to everyone for their suggestions. I decided to implement an extension so I could have <file>c:\path\to\file.doc</file>. It's simple and effective, and very user friendly.
MediaWiki is awesome, and now I can see why. These projects have such a capable and helpful developer base.
Thanks again! Michael.
From: Carlos angus@quovadis.com.ar Reply-To: Wikimedia developers wikitech-l@lists.wikimedia.org To: Wikimedia developers wikitech-l@lists.wikimedia.org Subject: Re: [Wikitech-l] Using spaces in file urls Date: Fri, 02 Feb 2007 10:44:17 +0100
Michael . wrote: [...]
I've gotten far enough with this using meta and mediawiki.org, and have enabled file:// links and a bunch of other stuff to make this posisble,
even
changing the browsers so file:// links are supported from the site. The
only
problem I've got left is what to do when there's a space in the file or directory name being linked to.
For example, if a file is stored in p:\docs\some user documentation.doc,
I
can't link to it in the wiki without setting $wgRawHtml and using the a href=... tag directly inside html tags. Not a very secure option, and
also
not very user-friendly. Substituting spaces for %20 doesn't work (IE
renders
the %20 directly for file:// links, it seems), and using [blah] doesn't work, becuase the first space gets regarded as the split between the url
and
the title of the link to be displayed. And an a href tag just gets
ignored,
despite my efforts to try and add it to the attribute whitelist.
I've been messing around for options for a few days now, and I've broken
and
unbroken everything a few times, by screwing with stuff like
Sanitize.php,
Linker.php, Parser.php, and so on. But despite being a long-term PHP developer, I can't figure this code out despite my best efforts.
So I'd like to ask the community if they have any suggestions on how I
can
achieve this? None of the code changes I made seemed to have any effect,
so
I'm at a loss as to what to do next.
Maybe you can create a simple markup extension, which transforms something like '<mylink href="file://p:\docs\a b c">Link</mylink>' into '<a href="file://p:\docs\a b c">Link</a>' (or what the correct HTML should be).
These extensions are very easy to build. The documentation is here: http://meta.wikimedia.org/wiki/Extending_wiki_markup
Good luck.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org