[pmwiki-users] Uploads Config on Farms -- UploadDir??

Patrick R. Michaud pmichaud at pobox.com
Tue May 23 17:13:39 CDT 2006

On Mon, May 22, 2006 at 03:15:47PM -1000, Sivakatirswami wrote:
> 1. I found one "gotcha' in the documentation. I don't feel competent  
> to edit PMwiki docs  so, let me just share "symptoms"
> Uploads Administration offers this example:
>   $EnableUpload = 1;
>        $UploadDir = "/home/john/public_html/uploads";
>        $UploadUrlFmt = "http://www.john.com/~john/uploads";
>        $DefaultPasswords['upload'] = crypt('mysecret');
> our wikis are  protected by .htaccess so I'm not using the upload  
> password... and the first line is in the farm script, which left   
> only these two for the field config.php
>   $UploadDir = "/admin/uploads";
> $UploadUrlFmt = "http://wiki.hindu.org/admin/uploads";
> but, if I keep that first line, then after the upload, PMwiki returns  
> a blank screen... by deleting the "$UploadDir" statement, it works  
> fine...

Note that "/admin/uploads" as a setting for $UploadDir is almost
certain to be wrong; $UploadDir holds a filesystem path name (relative
to the pmwiki directory), and not a url.  

> so, I don't know what is happening there.  it appears to work out of  
> the box without declaring any $UploadDir variable at all.

The documentation does say   "You may also need to explicitly set...";
here the keyword is "may".

> 2. Is there any way to globally enable to auto-creation of the sub- 
> directories on all fields under  /uploads/?

Assuming that each field is to have its "uploads/" directory in
the same directory that contains wiki.d/ -- this is PmWiki's default
and $UploadDir doesn't need to be set at all.

> suppose in  our server administration wiki  I have
> /admin/
> 	index.html
> 	local/
> 	uploads/
> 		Migration/
> 		Security/
> 	wiki.d/
> Now... someone comes in and he wants to make a new group called "CGI  
> Libraries"
> And, then he wants to upload a diagram... but PMWiki errors out  
> saying he needs  a writable directory  /CGILibraries/  before he can  
> accept an upload. So then he emails me... I log in via FTP or  
> terminal, mkdir... ....etc..

Make sure the uploads/ directory is writable, and it should work
automatically.  However, if your system's PHP is configured to run
in "safe_mode", then there's no way to automatically create the
per-group subdirectories and they must be created manually by the

> The desired behavior here is for anyone to be able to start a new  
> group and do uploads in any field on this farm without requiring  
> admin to make those directories... is this possible? 

This is PmWiki's default configuration, if the system's permissions
will allow it.


More information about the pmwiki-users mailing list