Permissions of uploaded files

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
twaso
Posts: 15
Joined: Thu 12. Jan 2006, 17:20
Contact:

Permissions of uploaded files

Post by twaso »

Phpwcms does have a permission problem with many hosting providers.

This problem affects files which are uploaded with the filemanager. Files uploaded with the file manager end up in the directory phpwcms_filestorage. This directory should have permissions 777. Files uploaded to this directory should get permissions 666 or at least 644.

On many installations these files get permissions of 600, which means they are not readable by the ftp account user. Thus you are not able to read the file or do anything with it. Particularly it is not possible to make a backUp of your phpwcms installation.

This problem has been discussed before and the recommended solution was to change the hosting service. I dont think this is a very good solution.

I am sure that a large number of users of phpwcms do have this problem and dont even know about it. The problem goes unnoticed by many users for a long time because everything seems to be OK until you are trying to make a backup, move your installation to a different server or try in any way to look at your file storage.

I would like to suggest to add a line of code that does a chmod 666 on every uploaded file, if at all possible. I think this would be a much better solution, since this modification would make phpwcms more compatible to many hosting services.

Unfortunately one of these incompatible hosters in Austria is inode. This provider is considered very innovative and usually does have very good customer service. Thus he is looked at as the gold standard of hosting in Austria and everything he does is copied by many other hosters, making even more hosters incompatible with phpwcms.

So please, if possible, could we make phpwcms more compatible?
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

Where would that be in the code? Do you know?
I can only see 0666 and 0777 settings throughout (except htmlarea which does 0755 and 0644).
I'd be interested in making that change if it is a problem. THANKS :D
twaso
Posts: 15
Joined: Thu 12. Jan 2006, 17:20
Contact:

Post by twaso »

Sorry, I dont know where the code for file management and uploading is. Thank you for trying to help.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

twaso wrote:Sorry, I dont know where the code for file management and uploading is. Thank you for trying to help.
Here's one place:
"/include/inc_tmpl/files.private.upload.tmpl.php"
twaso
Posts: 15
Joined: Thu 12. Jan 2006, 17:20
Contact:

Post by twaso »

Thanks DeXXus,

Unfortunately I dont know enough about php programming to do these modifications to the code myself.

Thomas
twaso
Posts: 15
Joined: Thu 12. Jan 2006, 17:20
Contact:

Post by twaso »

Problem solved. Added the following code to "/include/inc_tmpl/files.private.upload.tmpl.php"

Code: Select all

chmod($usernewfile, 0666);
see also:

http://www.phpwcms.de/forum/viewtopic.php?t=9790

Many thanks to DeXXus and pico,

Thomas
idom
Posts: 6
Joined: Wed 15. Feb 2006, 11:32
Location: Italy
Contact:

Post by idom »

ok. I have changed the line on the file files.private.upload.tmpl.php

but I have now this problem: what is with the images that are just on the server? this command functions with the new files upload, and sure not with the existing files on the dir phpwcms_filestorage.

I have made a restore of my db with phpmyadmin (I have configured a new server) and now I have seen that I have lost all the images of the file center, because they have 0600 rights. I am not able to transfer them with ftp.

I have the old db on another db server, I can work with the old and with the new server, but I want to delete the old db when the new db will work.

In my case I will lost not so much image files, I wanted to test how many problems will be, in the case of a data lost or restore.

Guido
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Hi

use a FTP-Client for changing the Permissions or if you have no possibility to use FTP - but this is not normal ?! - ask your Provider to do this for you.
Maybe your Provider has a WEB-HTTP-Based Management-Tool for manage your Website - or how have you uploaded your phpWCMS ?
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
idom
Posts: 6
Joined: Wed 15. Feb 2006, 11:32
Location: Italy
Contact:

Post by idom »

yes, I know, and so I will do. I will ask to my provider to change temporay the rights for this files. I can use ftp to transfer or to change the right of the files, I can also use an interface, but I am user xy and the files are generated from user "nobody" and so as the configuration is, I have no right to change the files that are generated from user "nobody".
It is right for me, to know now what can happen in this case. now I have set the file files.private.upload.tmpl.php as you described, but what will happen in the future with a new release? this is only a momentary change for the phpwcms right now, with this release.
I think that in the future I will not use the file option, but I will load my image files in the upload dir, where I can store, delete, rename or make what I want with my files.
Post Reply