CHMOD Issues..

SaintGRW

Golden Member
Oct 14, 2001
1,048
0
0
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?
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
It wouldn't.
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).
 

SaintGRW

Golden Member
Oct 14, 2001
1,048
0
0
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.....
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
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??
 

SaintGRW

Golden Member
Oct 14, 2001
1,048
0
0
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.
 

GagHalfrunt

Lifer
Apr 19, 2001
25,284
1,996
126
What language is the upload script? PHP can CHMOD file uploads, I assume that Perl can do so too.
 

GagHalfrunt

Lifer
Apr 19, 2001
25,284
1,996
126
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.
 

SaintGRW

Golden Member
Oct 14, 2001
1,048
0
0
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?
 

darktubbly

Senior member
Aug 19, 2002
595
0
0
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'];
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
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.
 

SaintGRW

Golden Member
Oct 14, 2001
1,048
0
0
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.

 

darktubbly

Senior member
Aug 19, 2002
595
0
0
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.
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
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?
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
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?
 

SaintGRW

Golden Member
Oct 14, 2001
1,048
0
0
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)
 

darktubbly

Senior member
Aug 19, 2002
595
0
0
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.
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
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:
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |