This website is deprecated, and remains online only for historic access to old issues and docs for historic versions of Virtualmin. It has been unmaintained for several years, and should not be relied on for up-to-date information. Please visit www.virtualmin.com instead.
One of our students just reported, that files uploaded using php get 600 permission. These files are not readable from a browser. How can I change that?
If you have access to the php source file (I mean, if its not encrypted)
look for the line where the php move the file from the temporary folder to the final target [ie: move_uploaded_file($tmp_name, $name);] and add this line:
chmod($name, 0644);
[of course you have to replace the variables in this example according to your souce]
It solves my problem, anyway I believe in some easier solution
[like set something in somewhere]
The simpler solution ought to be setting the default file mask. But I'm not sure if PHP is respecting the umask here. I'd love to hear from some PHP masters who can give us some guidance...I'm as confused by this behavior as you all are. ;-)
Hi Sebastian,
I had the very same problem here.
If you have access to the php source file (I mean, if its not encrypted)
look for the line where the php move the file from the temporary folder to the final target [ie: move_uploaded_file($tmp_name, $name);] and add this line:
chmod($name, 0644);
[of course you have to replace the variables in this example according to your souce]
It solves my problem, anyway I believe in some easier solution
[like set something in somewhere]
;)
The simpler solution ought to be setting the default file mask. But I'm not sure if PHP is respecting the umask here. I'd love to hear from some PHP masters who can give us some guidance...I'm as confused by this behavior as you all are. ;-)
--
Check out the forum guidelines!