Discussion:
chmod
Emiliano Boragina
2013-08-20 00:39:29 UTC
Permalink
Hello everyone,
I try to use chmod 0777, but the JPG file in my localhost I cant view.
I must enter in the windows properties of the JPG file, add the user with
full permission, and them i can view it.
I use this:
move_uploaded_file($file_tmp,"$desired_dir/".$file_name);
chmod("$desired_dir/".$file_name,0777);
What's wrong?
Thanks. Emiliano
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Matt Pelmear
2013-08-20 03:17:12 UTC
Permalink
Emiliano,

This question is totally out of scope for this mailing list. It has
nothing to do with databases at all.

Also, you should _almost never_ use 0777 for permissions.
You probably want 0644. (Owner can read/write, all others can read.)

Regarding your question in general, it sounds like you are running this
on a Windows environment. I can't personally speak to whether chmod()
works well in that environment or not (I would never run a windows
server or dev environment for that matter), but I suspect it may not be
working as expected based on what you are describing, especially if you
are using an older version of PHP.

I would be willing to further help you diagnose the problem (others may
be as well), but I really think this does not belong on this mailing
list and, as such, those discussions should be held off-list.

FYI, I think the appropriate forum for this question would be either the
"General user list" or, if you are indeed using Windows, the "Windows
PHP users list":
http://php.net/mailing-lists.php



-Matt
Post by Emiliano Boragina
Hello everyone,
I try to use chmod 0777, but the JPG file in my localhost I cant view.
I must enter in the windows properties of the JPG file, add the user with
full permission, and them i can view it.
move_uploaded_file($file_tmp,"$desired_dir/".$file_name);
chmod("$desired_dir/".$file_name,0777);
What's wrong?
Thanks. Emiliano
Loading...