troubles with images download via ftp
-
- Posts: 19
- Joined: Mon 10. Oct 2005, 19:30
troubles with images download via ftp
I want to download some pictures for example 20as302as0311091091.jpg on my computer by ftp.
But I don't have the rights to download it and i'm not able to change CHMOD to 777.
1. Is this because of phpwcms?
2. If yes, how can I download this pictures even though?
But I don't have the rights to download it and i'm not able to change CHMOD to 777.
1. Is this because of phpwcms?
2. If yes, how can I download this pictures even though?
Files uploaded via php should get permissions 644. Many providers are setting these permissions to 600 and are not going to change this policy for security reasons. They say it is not a problem for most of their customers, so why should it be a problem for the users of phpwcms.
I think we should do something about it. Changing hosting is not a solution, because the new hosting provider could adopt this permissions strategy at any point in the furture.
I think we should do something about it. Changing hosting is not a solution, because the new hosting provider could adopt this permissions strategy at any point in the furture.
I am sure 50% of all phpwcms users do have this problem and dont even know about it. This is because everything seems OK until you try to make a backup of your site. (Try to download your filestorage via ftp)
Backing up your whole site via ftp is very important, since the backup of your provider is only for the case that his machines die. It is useless if you get hacked or you mess something up yourself. In these cases the backup of your provider will also contain all the messed up files and you have lost everything.
Backing up your whole site via ftp is very important, since the backup of your provider is only for the case that his machines die. It is useless if you get hacked or you mess something up yourself. In these cases the backup of your provider will also contain all the messed up files and you have lost everything.
Hi
goto include/inc_tmpl/files.private.upload.tmpl.php search this (Line~97)
after this add
so that it look like
goto include/inc_tmpl/files.private.upload.tmpl.php search this (Line~97)
Code: Select all
} else {
$oldumask = umask(0);
if(@mkdir($useruploadpath, 0777)) {;
if(!@move_uploaded_file($_FILES["file"]["tmp_name"], $usernewfile)) {
$file_error["upload"] = $BL['be_fprivup_err3'].' (2)';
}
} else {
$file_error["upload"] = $BL['be_fprivup_err4'];
}
umask($oldumask);
}
so that it look like
Code: Select all
chmod($usernewfile, 0777);
Code: Select all
} else {
$oldumask = umask(0);
if(@mkdir($useruploadpath, 0777)) {;
if(!@move_uploaded_file($_FILES["file"]["tmp_name"], $usernewfile)) {
$file_error["upload"] = $BL['be_fprivup_err3'].' (2)';
}
} else {
$file_error["upload"] = $BL['be_fprivup_err4'];
}
umask($oldumask);
}
chmod($usernewfile, 0777);
if(!isset($file_error["upload"])) {..........
Hi Horst!
Problem solved. Funktioniert bestens! Habe chmod (0666) verwendet.
nochmals Danke! Vielleicht könnte man das in die offizielle Version integrieren.
lg.
Thomas
Problem solved. Funktioniert bestens! Habe chmod (0666) verwendet.
Code: Select all
chmod($usernewfile, 0666);
lg.
Thomas
To backup your existing files via FTP you will need to change the ownership of the files that have 'nobody' or 'apache' as user and group. To do that yourself you will need a shell access account with your host that allows you to log in as 'root'.
Assuming you can do that, login and change directory to your main web root, e.g.
Next, use the LS command with the -l switch (that's a lower-case 'L') to get a directory listing.
This will reveal your username and group next to the files you 'own', e.g:
index.php -rw-r--r-- me mygroup
You then need to use the CHOWN command to change ownership of the files in 'phpwcms_filestorage' to your user and group.
The -R switch recursively changes the owner of all the files in the folder, plus any sub-folders. Run the LS command again afterwards to check that ownership has changed.
You should now be able to change permissions and download via your FTP application.
I assume the above hack is now a permanent feature of PHPWCMS
Assuming you can do that, login and change directory to your main web root, e.g.
Code: Select all
# cd /var/www/httpdocs
Code: Select all
# ls -l
index.php -rw-r--r-- me mygroup
You then need to use the CHOWN command to change ownership of the files in 'phpwcms_filestorage' to your user and group.
Code: Select all
# chown -R me.mygroup phpwcms_filestorage
You should now be able to change permissions and download via your FTP application.
I assume the above hack is now a permanent feature of PHPWCMS
Re: troubles with images download via ftp
Hello all!
The new version 1.3.5 seems to re-establish this problem: Newly uploaded files through
the filemanager only have permission CHMOD 600, so that thumbnails or resized versions
are not shown in the browser.
In the file "include/inc_tmpl/files.private.upload.tmpl.php", at the point Pico pointed out,
there is already a new line to be found:
But it doesn't seem to work. My provider is unwilling to change the standard-chmod
of the server to anything else than CHMOD600. He was helpful though in putting in
some "echos" in this file, and reported that the CHMOD-line above does not get
parsed... has anyone else experienced the same? Is this a bug? Should I contact OG?
It would be great if someone could help me with this issue, I don't know what to do now... :[
------------------------------
Hallo zusammen,
mit der phpwcms-Version 1.3.5 habe ich leider auch wieder das ursprüngliche Problem:
Wegen mangelnder Rechte der hochgeladenen Dateien (CHMOD 600) werden keine
Thumbnails generiert.
An der von Pico beschrieben Stelle in der Datei include/inc_tmpl/files.private.upload.tmpl.php
findet sich in der Version 1.3.5 auch schon die Zeile
Dennoch haben hochgeladene nur CHMOD 600. Der Provider ist leider ist leider nicht dazu
zu bewegen, diese Standardeinstellung zu ändern. Er hat jedoch probehalber "echos" in die
include/inc_tmpl/files.private.upload.tmpl.php eingebaut, und nach seiner Aussage wird
die obige Codezeile mit dem CHMOD 0666 gar nicht verarbeitet... was also nun?
Wäre toll, wenn mir jemand hier weiterhelfen könnte, da sitze ich wirklich etwas in der Patsche... :[
The new version 1.3.5 seems to re-establish this problem: Newly uploaded files through
the filemanager only have permission CHMOD 600, so that thumbnails or resized versions
are not shown in the browser.
In the file "include/inc_tmpl/files.private.upload.tmpl.php", at the point Pico pointed out,
there is already a new line to be found:
Code: Select all
if(file_exists($usernewfile)) {
chmod($usernewfile, 0666);
}
of the server to anything else than CHMOD600. He was helpful though in putting in
some "echos" in this file, and reported that the CHMOD-line above does not get
parsed... has anyone else experienced the same? Is this a bug? Should I contact OG?
It would be great if someone could help me with this issue, I don't know what to do now... :[
------------------------------
Hallo zusammen,
mit der phpwcms-Version 1.3.5 habe ich leider auch wieder das ursprüngliche Problem:
Wegen mangelnder Rechte der hochgeladenen Dateien (CHMOD 600) werden keine
Thumbnails generiert.
An der von Pico beschrieben Stelle in der Datei include/inc_tmpl/files.private.upload.tmpl.php
findet sich in der Version 1.3.5 auch schon die Zeile
Code: Select all
if(file_exists($usernewfile)) {
chmod($usernewfile, 0666);
}
zu bewegen, diese Standardeinstellung zu ändern. Er hat jedoch probehalber "echos" in die
include/inc_tmpl/files.private.upload.tmpl.php eingebaut, und nach seiner Aussage wird
die obige Codezeile mit dem CHMOD 0666 gar nicht verarbeitet... was also nun?
Wäre toll, wenn mir jemand hier weiterhelfen könnte, da sitze ich wirklich etwas in der Patsche... :[
Re: troubles with images download via ftp
For me all files which are written to this directory by phpwcms are CHMOD 0666.
But unlike the original files I once uploaded to the server
USER and OWNER now are --> 'nobody'
When you log in to your server using FTP with your --> USERNAME 'ftp123abcXYZ' you'll need at least '0604' for the files to be able to download (as you are not 'nobody' or within its group).
If you can't manage CHMOD / are not allowed to manage YOUR files by the web provider, I would terminate/cancel the agreement asap and use another one for hosting my sites.
The problem you have isn't phpwcms related but you will have the samewith ANY other web app on this server as well.
But unlike the original files I once uploaded to the server
USER and OWNER now are --> 'nobody'
When you log in to your server using FTP with your --> USERNAME 'ftp123abcXYZ' you'll need at least '0604' for the files to be able to download (as you are not 'nobody' or within its group).
If you can't manage CHMOD / are not allowed to manage YOUR files by the web provider, I would terminate/cancel the agreement asap and use another one for hosting my sites.
The problem you have isn't phpwcms related but you will have the samewith ANY other web app on this server as well.