Pushfile Plugin

Introduction

Allows files stored in the media folder of the Dokuwiki to be "pushed" to the user so that they are downloaded rather than displayed.

Details

The pushfile.php utility can be used to create download links such as http://www.fhug.org.uk/pushfile.php?filename=folder/icons.zip optionally with link text like this:

[[http://www.fhug.org.uk/pushfile.php?filename=folder/icons.zip]]
[[http://www.fhug.org.uk/pushfile.php?filename=folder/icons.zip|link text]]

Filenames are usually composed entirely of lower-case characters and underscores (_). The utility automatically replaces each underscore in the filename with a space character as it is downloaded. Other parameters offer further options.

  • ns= specifies only a full namespace, e.g. ns=/fhugdownloads/contents, where / replaces the usual colon :.
  • name= lets the filename be changed, e.g. name=Census%20Icons, where %20 represents a space character.

So to download :fhugdownloads:contents:janescensusicons.zip as Jane's Census Icons.zip would require:

[[http://www.fhug.org.uk/pushfile.php
?ns=/fhugdownloads/contents
&filename=janescensusicons.zip
&name=Jane's%20Census%20Icons
|Jane's Census Icons]]

Pushfile Plugin Macro

The pushfile Control Macro provides a shorthand alternative, which allows files stored in the media folder namespace of the DokuWiki to be “pushed” to the user, so that they are downloaded rather than displayed.

janescensusicons.zip Jane's Census Icons

{{pushfile>:fhugdownloads:contents:janescensusicons.zip|Jane's Census Icons}}

Either the namespace must be specified in full, or if only the filename is specified it will assume the current page namespace. Thus notations such as . and .: will not work.

Section extras