, !
PmWiki upload.php . ( ) . .
PmWiki . , :
-
- ,
- , ()
- ( ) : , , , .
- ( 50K)
/ .
, (!) . upload.php , , , .
, . config.php:
$EnableUploadOverwrite = 0;
, .
- PmWiki , .
$EnableUpload
config.php , stdconfig.php upload.php. , URL $UploadDir
$UploadUrlFmt
config.php. , $UploadDir
$UploadUrlFmt
, uploads/ ( pmwiki.php). , config.php ( ).
, config.php :
<?php if (!defined('PmWiki')) exit();
## Enable uploads and set a site-wide default upload password.
$EnableUpload = 1;
$DefaultPasswords['upload'] = crypt('secret');
: uploads. .
URL :
$UploadDir = "/home/john/public_html/uploads";
$UploadUrlFmt = [="http://www.john.com/~john/uploads";=]
$UploadPrefixFmt
, . , . , .
:
$UploadPrefixFmt = '';
, :
$UploadPrefixFmt = '/$FullName';
$UploadPrefixFmt = '/$Group/$Name';
, $UploadDir , (, public_html). PmWiki ( ).
, "?action=upload
" URL PmWiki. ( , , Passwords ).
- "Attach:filename.ext
" , filename.ext
. , '?-' .
, PmWiki . $UploadPrefixFmt
. Cookbook:UploadGroups.
, PmWiki . , $EnableUploadVersions
=1; .
. $EnableUpload
=1;
, ; $EnableUpload
=1;
config.php $EnableUpload
=0;
, .
. :
-
- , , , , . .
-
- , "
.gif
", ".jpeg
", ".doc
", . , ".php
", ".cgi
" ..
-
- 50- ,
$UploadMaxSize
. , $UploadMaxSize
config.php:
$UploadMaxSize = 102400;
, . , ".gif
" ".jpeg
" 20- , $UploadMaxSize
. $UploadExtSize
( ). :
$UploadExtSize['gif'] = 20480; # .gif 20K
:
$UploadExtSize['zip'] = 0; # .zip
:
$UploadExts['ext'] = 'content-type';
ext content-type (MIME ) . , 'dxf
' 'image/x-dxf
' :
$UploadExts['dxf'] = 'image/x-dxf';
$UploadExts
mime- , :
$UploadExts = array(
'gif' => 'image/gif',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'png' => 'image/png',
'xxx' => 'yyyy/zzz'
)
, PmWiki ( ''upload.php' PmWiki ).
. Apache 2.0 LimitRequestBody (posted) ( ). Apache . , Linux ( .. Red Had Linux) 512 , . ( httpd.conf /etc/httpd/conf.d.)
Red Hat 8.0/9.0 Apache 2.0.x "Requested content-length of 670955 is larger than the configured limit of 524288" "Page not found"( ). PHP, .. Red Hat 8.0/9.0 PHP /etc/httpd/conf.d/php.conf. "LimitRequestBody 524288" .
PHP ( /etc/php.ini). - upload_max_filesize
2M. -- post_max_size
6.
: PmWiki , Apache PHP.
( ) , ( uploads/) :
Cookbook:SecureAttachments.
- , PHP . php.ini( /etc/php.ini /usr/local/lib/php.ini)
file_uploads = On
, , httpd ( ) (restart). - $EnableDiag
=1 (config.php) ?action=phpinfo URL. "file_uploads
" 1 ( "no value
", - ).
<< Benutzerautorisierung | DocumentationIndex | Internationalizations >>