PmWiki /
Upload Variables
< Security Variables | Variables | Blocklist >
See also: Uploads, Uploads admin.
- %apply=item id=Enable Upload?%
$EnableUpload - The upload.php script is automatically included from stdconfig.php if the
$EnableUploadvariable is true in config.php. Note that one may still need to set an upload password before users can upload (see UploadsAdmin). - %apply=item id=Upload Dir?%
$UploadDir - The directory where uploads are to be stored. Defaults to uploads/ in the pmwiki directory, but can be set to any location on the server. This directory must be writable by the webserver process if uploading is to occur.
- %apply=item id=Upload Url Fmt?%
$UploadUrlFmt - The url of the directory given by
$UploadDir. By default,$UploadUrlFmtis derived from$PubDirUrland$UploadDir.
$IMapLinkFmt['Attach:']
The format of the upload link displayed when an attachment is present. No default is set.
- %apply=item id=Link Upload Create Fmt?%
$LinkUploadCreateFmt - The format of the upload link displayed when an attachment not present. Defaults to
<a class='createlinktext' href='\$LinkUpload'>\$LinkText</a>
<a class='createlink' href='\$LinkUpload'> Δ</a>");
- %apply=item id=Upload Prefix Fmt?%
$UploadPrefixFmt - Sets the prefix for uploaded files to allow attachments to be organized other than by groups. Defaults to
'/$Group'(uploads are organized per-group), but can be set to other values for sitewide or per-page attachments.
$UploadPrefixFmt= '/$Group/$Name'; # per-page attachments$UploadPrefixFmt= ''; # sitewide attachments
- It is recommended to have the
$UploadPrefixFmtvariable defined in config.php, the same for all pages in the wiki, and not in group/page local configuration files. Otherwise you will be unable to link to attachments in other wikigroups. - %apply=item id=Enable Direct Download?%
$EnableDirectDownload - When set to 1 (the default), links to attachments bypass Pm Wiki and come directly from the webserver. Setting
$EnableDirectDownload=0; causes requests for attachments to be obtained via?action=download. This allows Pm Wiki to protect attachments using a page's read permissions, but also increases the load on the server. Don't forget to protect your directory /uploads/ with a .htaccess file (Order Deny,Allow / Deny from all). - %apply=item id=Enable Upload Group Auth?%
$EnableUploadGroupAuth - Set
to authenticate downloads with the group password. This could be used together with$EnableUploadGroupAuth= 1;.$EnableDirectDownload= 0; - %apply=item id=Enable Upload Versions?%
$EnableUploadVersions - When set to 1 (default is 0), uploading a file to a location where a file of the same name already exists causes the old version to be renamed to
file.ext,timestamp(instead of being overwritten).timestampis a Unix-style timestamp. - %apply=item id=Enable Upload Overwrite?%
$EnableUploadOverwrite - When set to 1 (the default), determines if overwriting previously uploaded files is allowed.
- %apply=item id=Upload Name Chars?%
$UploadNameChars - The set of characters allowed in upload names. Defaults to
"-\w. ", which means alphanumerics, hyphens, underscores, dots, and spaces can be used in upload names, and everything else will be stripped. $UploadNameChars= "-\\w. !=+"; # allow exclamations, equals, and plus$UploadNameChars= "-\\w. \\x80-\\xff"; # allow unicode- %apply=item id=Make Upload Name Patterns?%
$MakeUploadNamePatterns - An array of regular expression replacements that is used to normalize the filename of an attached file. First, everything but
$UploadNameCharswill be stripped, then the file extension will be converted to lowercase. Administrators can override these replacements with a custom definition (the full array needs to be defined). - %apply=item id=Upload Dir Quota?%
$UploadDirQuota - Overall size limit for all uploads.
$UploadDirQuota = 100*1024; # limit uploads to 100KiB $UploadDirQuota = 1000*1024; # limit uploads to 1000KiB $UploadDirQuota = 1024*1024; # limit uploads to 1MiB $UploadDirQuota = 25*1024*1024; # limit uploads to 25MiB $UploadDirQuota = 2*1024*1024*1024; # limit uploads to 2GiB
- %apply=item id=Upload Prefix Quota?%
$UploadPrefixQuota - Overall size limit for one directory containing uploads. This directory is usually
Group Name?(one for every Wiki Group), oruploads/Page Name?(one for every page), depending on the variable$UploadPrefixFmt. - %apply=item id=Upload Max Size?%
$UploadMaxSize - Maximum size for uploading files, 50000 octets (bytes) by default.
- %apply=item id=Upload Ext Size?%
$UploadExtSize - Maximum size per extension, overriding the default in
$UploadMaxSize.
$UploadExtSize['zip'] = 2*1024*1024; # allow up to 2MiB for zip files
< Security Variables | Variables | Blocklist >
This page may have a more recent version on pmwiki.org: PmWiki:UploadVariables, and a talk page: PmWiki:UploadVariables-Talk.