Uploads
Note: PmWiki is distributed with uploads disabled by default. See UploadsAdmin for information about how to enable and configure the upload feature.
PmWiki can allow authors to upload and attach files to pages. Each WikiGroup can have its own collection of named attachments that are shared among all pages in the group. To add or link to an attachment, an author simply edits a page to include the markup "
Page last modified on June 18, 2004, at 05:06 AMAttach:" followed by a name for an attachment (e.g., "Attach:resume.pdf"). When the page is displayed, the Attach: markup becomes either a link to the named attachment, an image (if the attachment is an image file such as a .gif or .jpeg), or a link to a form where the author can specify a file to be uploaded and used as the new attachment.
One can also go directly to the upload form by adding "?action=upload" to the URL for any page that has file uploads enabled by the WikiAdministrator.
For security reasons, the upload feature is disabled when PmWiki is first installed, and once enabled uploads are generally restricted as to the types and sizes of files that may be uploaded to the server (see UploadsAdmin). PmWiki's default configuration limits file sizes to 50 kilobytes and file extensions to common types such as ".gif", ".jpg", ".doc", ".txt", and ".pdf". In addition, the administrator can configure the system to require an upload password--see Passwords and PasswordsAdmin.
By default the upload allows the following extensions:
'gif','jpg','jpeg','png','bmp','ico','wbmp', # images
'mp3','au','wav', # audio
'mpg','mpeg','wmf','mov','qt','avi', # video
'zip','gz','tgz','tar','rpm','hqx', # archives
'doc','ppt','xls','exe','mdb', # MSOffice
'pdf','psd','ps','ai','eps', # Adobe
'htm','html','fla','swf', # web stuff
'txt','rtf','exe','tex','dvi','' # misc
At present uploaded files can only be deleted from the server by the WikiAdministrator.
The markup [[$Attachlist]] can be used to display a list of attachments that have already been uploaded. The order in which attachments are display can also be specified by adding "X=A" or "X=D", where X is one of 'N', 'S', or 'M' indicating that attachments should be ordered by name, size, or modification date, and 'A' and 'D' are used to specify ascending or descending sequence. Thus [[$Attachlist S=A]] will display attachments by size from smallest to largest, and [[$Attachlist M=D]] will display attachments in reverse chronological sequence.
Currently authors can experiment with the upload feature at http://www.pmichaud.com/wiki/Main/WikiSandbox.
Notes
- On Windows, I've had to make this fix to make the upload work. In upload.php, change this line:
Redirect($pagename,
'$PageUrl?action=upload&upname='.urlencode($UploadName)."&$result");
to
Redirect($pagename,
"$PageUrl?action=upload&upname=".urlencode($UploadName)."&$result");
Notice the quote differences. Otherwise, the & sign won't be translated correctly. Can't say I know why. --Wayne
Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Anchorage' for 'AKDT/-8.0/DST' instead in /Users/dan/Sites/ofolio/pmwiki/pmwiki.php on line 647
<< WikiStyles | PmWiki.DocumentationIndex | SimpleTables >>
Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Anchorage' for 'AKDT/-8.0/DST' instead in /Users/dan/Sites/ofolio/pmwiki/pmwiki.php on line 647
