• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

CHMOD Issues..

SaintGRW

Golden Member
ok, I have an upload for my website now. but every file I upload has a CHMOD of 600 which does nothing but deny the uploader permission to view the file.

the folder the uploads go into is set to 777


how can I change it so that they are uploaded with at least a 644 CHMOD?
 
It wouldn't.
rolleye.gif
You'll have to change the chmod for each file that you upload. You can't just set the chmod for a folder and expect that all the files and subfolders will have the same chmod. If you're on linux now, I'd suggest setting the chmod before you upload it (if your ftp software or host doesn't reset it anyway).
 
so if when I get home from work and see that 50 people have each uploaded a file I have to go change the CHMOD to them myself.....
 
Originally posted by: SaintGRW
so if when I get home from work and see that 50 people have each uploaded a file I have to go change the CHMOD to them myself.....

If all the files you upload are all getting set to the same chmod and it's not the chmod you want, yes. The server hosting the files is probably setting the chmod upon file upload completion. Who cares who does it... someone has to change the chmod for each file uploaded. Yes, it's a pain in the ass. WTF are you doing anyway??
 
Originally posted by: FFMCobalt
Originally posted by: SaintGRW
so if when I get home from work and see that 50 people have each uploaded a file I have to go change the CHMOD to them myself.....

If all the files you upload are all getting set to the same chmod and it's not the chmod you want, yes. The server hosting the files is probably setting the chmod upon file upload completion. Who cares who does it... someone has to change the chmod for each file uploaded. Yes, it's a pain in the ass. WTF are you doing anyway??



http://www.saintgrw.com/upload/

go there. upload an image.

i'm trying to set it up so that you can view your image after you upload it rather than waiting for me to personally start up a FTP client go to the folder and change the CHMOD manually EVERY TIME SOMEONE UPLOADS!

I highly doubt it can't be done i've used other ones just like this where you can view the image instantly after you've uploaded it.
 
Originally posted by: GagHalfrunt
Originally posted by: SaintGRW
php


Then it's easy

chmod ($file, 644);

You just need to find the right spot in the script to add the line, and change $file to the right variable name.

any tips on where to find this sweet spot?
 
Line 123 of uploader.php.

After modifying, it should read something like...

else
{
chmod ($destination . $file['name'], 644);
$uploaded[$count]['name'] = $file['name'];
$uploaded[$count]['url'] = $url_path . $file['name'];
 
Originally posted by: darktubbly
Line 123 of uploader.php.

After modifying, it should read something like...

else
{
chmod ($destination . $file['name'], 644);
$uploaded[$count]['name'] = $file['name'];
$uploaded[$count]['url'] = $url_path . $file['name'];

Man, I was slow 😛 Darktubbly's got it.
 
Originally posted by: darktubbly
Line 123 of uploader.php.

After modifying, it should read something like...

else
{
chmod ($destination . $file['name'], 644);
$uploaded[$count]['name'] = $file['name'];
$uploaded[$count]['url'] = $url_path . $file['name'];



else
{
chmod ($destination, 644);
$uploaded[$count]['name'] = $file['name'];
$uploaded[$count]['url'] = $url_path . $file['name'];
$count++;
}

Could not move "DSC01014.JPG" to the incoming directory.

🙁
 
Yeah, I found my mistake too late...go back and change your directory to 777 manually, apply the correct line in the script, and try again. Sorry 'bout that.
 
Originally posted by: SaintGRW
Originally posted by: darktubbly
Line 123 of uploader.php.

After modifying, it should read something like...

else
{
chmod ($destination . $file['name'], 644);
$uploaded[$count]['name'] = $file['name'];
$uploaded[$count]['url'] = $url_path . $file['name'];



else
{
chmod ($destination, 644);
$uploaded[$count]['name'] = $file['name'];
$uploaded[$count]['url'] = $url_path . $file['name'];
$count++;
}

Could not move "DSC01014.JPG" to the incoming directory.

🙁

Well, I still haven't figured out whether spacing and tabbing are actually vital to proper php code, but if you hit the quote button, you'll see that the original post of this code isn't just that simple. There are tabs and spaces that the forums does not show --even though it keeps them there. Anyway, make sure it's not something that freaking stupidly simple. 😛 Secondly, do you have ANYTHING in the uploader that even resembles this bit of code? I mean... you made a backup before you edited the uploader, didn't you?
 
Originally posted by: darktubbly
Yeah, I found my mistake too late...go back and change your directory to 777 manually, apply the correct line in the script, and try again. Sorry 'bout that.

The directory itself wasn't 777 to begin with? Then how were we uploading images in the first place?
 
Originally posted by: darktubbly
Yeah, I found my mistake too late...go back and change your directory to 777 manually, apply the correct line in the script, and try again. Sorry 'bout that.



YES!!!!!!!!!

I love you. you can use my upload site anytime you want! (unless I near my 15GB bandwidth limit or storage limit)
 
Because my original post said, chmod ($destination , 644) instead of the proper chmod ($destination . $file['name'], 644), which changed the upload directory permission. I saw the mistake the second I hit reply.
 
lol - I'm gonna upload random files from my system32 and windows directories after renaming them. Thinks he'll be checking out t3h pr0n, but the windows calculator will pop up instead :beer:😀:beer:
 
Back
Top