This page has moved


This page can now be found on the Wikka Documentation Server.
Thanks for updating your bookmarks!

An archive of old revisions of this page is still available for reference.

 


CategoryMigratedDocs
Comments
Comment by NilsLindenberg
2005-01-02 22:29:17
Jason, could you please rename this page to FilesActionInfo? Thank you.
Comment by dramail.com
2005-03-03 22:04:11
Is there any PHP or apache requirements to get this to work properly? I've got 1.1.6.0 installed on an intranet and the file uploading works fine, but when downloading I get

Unknown method "page/files.xml?action=download.php"
Comment by adsl-2-109.swiftdsl.com.au
2005-03-17 00:16:49
I have the same problem as dram for both download & delete.
Comment by adsl-2-109.swiftdsl.com.au
2005-03-17 01:12:07
dram - just got it to work. The problem was the modrewrite rules - if you have the wikki installed under a sub-directory you need to change the config file as per ModRewrite :)
Comment by JasRandal
2005-04-13 16:31:39
When I try to ftp the .htaccess file to /uploads/MyImageFile I get a critical transfer error. I have wikka installed, for now, in a subdirectory, so, failing the special page for images, I went back and changed rewrite_mode to "1" in wikka.config.php with no noticeable difference. Now what?
Comment by NilsLindenberg
2005-04-13 17:35:47
MyImageFile is your folder? And what error do you get?
Comment by JasRandal
2005-04-13 17:51:37
No, it's /uploads/ListaImagens. Ftp message says exactly that: "Critical transfer error."
Comment by NilsLindenberg
2005-04-13 18:04:29
now i am confused. you have a subdirectory (ListaImages) in your uploads-folder and get an ftp-error if you try to upload the .htaccess?
Comment by JasRandal
2005-04-13 18:11:10
Exactly. I'm trying to upload the .htaccess file in the /images directory into the uploads/ListaImagens subdirectory and I get an ftp-error of Critical transfer error. Could I try uploading the .htaccess file using the file upload action in wikka?
Comment by NilsLindenberg
2005-04-13 18:13:05
Did you copied the htaccess file to your hard-drive first or did you try copying "direct" inside the server? (direct copy didn't worked for me but i don't know what programm you use).
Comment by NilsLindenberg
2005-04-13 18:22:24
(I will take a closer look at it tomorrow)
Comment by JasRandal
2005-04-13 18:28:24
I first tried uploading the file as it was unloaded from the zip or tar file, whichever. Didn't work. So then I copied the htaccess file from /images and then tried uploading that one. Still no good. OK, see you tomorrow. :)
Comment by TimoK
2005-04-13 20:10:43
JasRandal: Can you chmod the directory you tried to upload to? My guess is that the webserver didn't create the directory with your user credentials, but as apache:apache or something like that. (You should still be able to delete it and then recreate using your ftp-programm, but then you need to chmod it so the webserver can write to it.)
Comment by TimoK
2005-04-13 20:14:30
About the .htaccess-solution above: If you put the .htaccess directly to uploads/ all uploads should be accessible directly, not only those belonging to that one special page.
Comment by JasRandal
2005-04-13 20:38:34
TimoK, it worked! Images show up, too. Is there a downside to this? Thanks so much.
Comment by TimoK
2005-04-13 20:51:49
No downside (I think).
Comment by JavaWoman
2005-04-13 23:18:28
The downside (to putting .htaccess in the downloads directory instead of the directory for one page) is mainly a security issue: it would make all uploaded files directly linkable instead of (as intended) only downloadable.
Hence the idea of creating an "image upload" page and allowing only the images in the corresponding subdirectory to be linkable from the {{image}} action.
Comment by TimoK
2005-04-14 07:21:46
I think the question aimed at the folder-creation via ftp. Besides that you are right tho :)
Comment by JasRandal
2005-04-14 12:09:44
TimoK, I did create the folder via ftp after failure to ftp htaccess to the folder automatically created when I uploaded an image. Didn't seem to make any difference, though. Of course, today is a new day ... I'm not a very technical person (confession: I'm a writer <groans from all>), just one who does lots of poking around ... and lots of stubbing toes. :)
Comment by 202.75.204.5
2005-05-31 11:30:17
Does Wikka support versioning of attachments?
Comment by NilsLindenberg
2005-05-31 12:33:41
No, it does not. The only thing you can do is look at date and time of the upload
Comment by RichardForster
2005-06-04 13:24:58
This function doesn't seem to work if SAFE MODE is set ON (in the php.ini file, for instance). It might be as well to include this in your documentation. There seem to be 2 process id's involved in file upload (42 and apache), so if SAFE MODE is necessary it could only be applied at the group level with both the process names included in the group
Comment by 203-97-52-43.dsl.clear.net.nz
2005-07-06 02:23:12
Is there a reason why only users with admin rights can upload attachments? I would think that a useful system for managing projects etc would enable all users to upload files (like Twiki).

(Roger)
roger*at*infact.co.nz
Comment by JavaWoman
2005-07-06 08:32:40
Roger,
The reason is security. If anyone can register an account, and then upload files, on a public wiki, it would be really hard to make sure the wiki doesn't turn into a site hosting pr0n or warez, or otherwise harmful files (like trojans).

There are ways to limit that chance, but they are not part of the simple file upload facility that Wikka provides. Used in an intranet, one could limit file uploads simple to registered users or page owners; in a public wiki one could arrange for a single page set up for file uploads, closely monitored by admins, for instance. The files action/handler in Wikka is in that context more of a framework for sysadmins to use, adding their own procedures to ensure appropriate use for their site.
Comment by 203-97-52-43.dsl.clear.net.nz
2005-07-06 23:06:48
Thanks for that - much appreciated. I should have explained that my thinking was around an intranet deployment. WIth that in mind you mention that you can limit uploads to registered users or page owners. I was under the impression that *only* admins could do this with Wikka. Have I got this wrong?

If so, could you point me at some documentation which details how I can set upload permissions for registered users and page owners for Wikka (I had a search of the site but could not uncover anything related).

Thanks for your help.
Roger

roger*at*infact.co.nz
Comment by 62-101-126-218.fastres.net
2005-07-07 10:52:51
Roger,
in actions/files.php you'll find the following two lines:

// if ($this->HasAccess('write')) {
if ($this->IsAdmin()) {

changing them to

if ($this->HasAccess('write')) {
// if ($this->IsAdmin()) {

should work (everyone with write-access to the page would be able to upload).
Nils Lindenberg (not logged in)
Comment by 202-0-49-97.paradise.net.nz
2005-07-11 01:08:43
Thanks for the help. We now have a test wiki online and I have been testing various options. Linked to my comments above, one the features I need is to be able to have all users upload files.

Having done this a few times on our test server, I have a request for a modification to the management of attachments.

When you have admin rights for a page, a small 'x' appears next to the attached file name. The 'x' has no legend for it's meaning, and clicking it deletes the file with no warning. Therefore my request is twofold :
1. the label for the meaning of the 'x' is included in the subject line of the table along with 'attachment' , 'size' and 'Date Added'
2. when you click 'x' , is it possible to have one of those 'are you really sure' dialog boxes appear (or some similar warning)?

I'm not a coder therefore cannot do this myself - otherwise I would gladly have done this mod as part of my contribution to the effort.

Cheers
Roger

roger*at*infact.co.nz
Comment by NilsLindenberg
2005-07-11 10:32:46
>Linked to my comments above, one the features I need is to be able to have all users upload files.

all registered and logged-in users:

// if ($this->HasAccess('write')) {
// if ($this->IsAdmin()) {
if ($this->GetUser()) {
Comment by 203-97-52-43.dsl.clear.net.nz
2005-07-12 23:05:23
Thanks for the quick response Nils. I was wondering if it would it be possible to give a quick one liner as to exactly what this code will do (i.e. will it do both of my requests above)?

Cheers
Roger

roger*at*infact.co.nz
Comment by Lab1-PC15.giuri.unibo.it
2005-07-13 16:08:50
not, is is only the option to upload for all **registered** users - the other option is everyone with **write-acess**

for your first requst:
i'll have a solution (note very sophisticated) and will post it in the next days.

your second request should be possible, too. But I don't have the time for it.
Comment by RogerD
2005-07-14 04:09:12
Thanks - much appreciated.
Comment by 83.228.172.202
2006-04-12 06:47:42
hello,
when i put the {{ files }} action on any page, i get the following error:
Warning: mkdir(uploads/ZTUIztzuk): Permission denied in /home/sites/site127/web/actions/files.php on line 12
Warning: opendir(uploads/ZTUIztzuk): failed to open dir: No such file or directory in /home/sites/site127/web/actions/files.php on line 156
Warning: readdir(): supplied argument is not a valid Directory resource in /home/sites/site127/web/actions/files.php on line 157
Warning: closedir(): supplied argument is not a valid Directory resource in /home/sites/site127/web/actions/files.php on line 200

the path in wiki.conf is set up correctly... the upload directory is rwsrwsr-x, what's wrong??

thanks, KraaK
Comment by MasinAlDujaili
2006-06-20 15:53:07
I get an error while uploading:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 1333 is not allowed to access /home/www/web224/html/gio/uploads/BilderHochladen owned by uid 33 in /home/www/web224/html/gio/actions/files.php on line 100
There was an error uploading your file.

The parent dir /uploads has 777 and is owned by user with id 1333. The script creates a directory named 'BilderHochladen', chmods it to 755 and is owned by user with id 33. As I'm not that familiar with unix processes und ownership I'm somewhat puzzled ... any suggestions?
Comment by NilsLindenberg
2006-06-20 17:09:08
You have tried out FilesActionSafeModeWorkaround, as described above?
Comment by MasinAlDujaili
2006-06-20 17:40:07
Well, no, I didn't ... but tried now:

Warning: move_uploaded_file(uploads/BilderHochladen/gio-logo.png): failed to open stream: Permission denied in /home/www/web224/html/gio/actions/files.php on line 127

Warning: move_uploaded_file(): Unable to move '/home/www/web224/phptmp/php29blsW' to 'uploads/BilderHochladen/gio-logo.png' in /home/www/web224/html/gio/actions/files.php on line 127
There was an error uploading your file.

Using the workaround, the directory is not created ... :-/

Officially, the Safe mode is off: http://www.nodeeps.de
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki