PDA

View Full Version : Change permissions of uploaded files


Zolotovskov
08-18-2006, 01:48 PM
Hello.

I've noticed that all files I upload trough the upload field to the upload dir have the insufficient permission to be viewed in the dirrectory (I've tried to add uploaded images). How do I change the permissions of uploaded files (to 777) automatically?

Sergey Ten
08-22-2006, 06:05 PM
Hello Zolotovskov,

I hope this code help you. I found this example in the PHP manual.


<?php
chmod("/somedir/somefile", 755); // decimal; probably incorrect
chmod("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect
chmod("/somedir/somefile", 0755); // octal; correct value of mode
?>

Dave Baker
08-23-2006, 12:45 PM
Hello Zolotovskov,
Problem in yours .htaccess (uploads/.htaccess) file. Most probably you have in .htaccess following contents.

Deny from all

Remove it %)

Zolotovskov
08-23-2006, 05:17 PM
Sergey, thank you, but what should I do with this code? Where should I put it?
Should I use all lines of code or only the third one?
Dave, I've removed it the first thing, but it didn't work.

Dave Baker
08-24-2006, 05:24 AM
Zolotovskov, probably you haven't rights to copying and viewing, but script will work normally. Has checked up on the experience. Probably you have fault in logic of modification. What do you want to modify?

Zolotovskov
08-25-2006, 08:49 AM
Dave, I have full rights. I've installed the script.

I want users to be able to upload thumbnails of their sites. I know that eSyndiCat doesn't allow that by default so I need to hack into.

I've added upload field and tricked "alexa thumbnails" into showing what users have uploaded with their submission. The problem is that everyting they upload have a 600 permission and images doesn't show untill I CHMOD them to 777 (I use SmartFTP). Deleting uploads/.htaccess file doesn't help.

This is what I need to do. Do you know a way?

Zolotovskov
08-25-2006, 08:55 AM
Ok, I think I've found a solution (http://www.esyndicat.com/forum/showthread.php?t=6555&highlight=upload), but I'm sure I've tried it at least once... will only be able to test it again tomorrow.

so just in case, if anyone knows of a solution - please share :)

Dave Baker
08-25-2006, 11:51 AM
Zolotovskov I made custom modification on my local copy similar with this modification: http://www.esyndicat.com/forum/about6332.html , but with uploading images.
I assure you that a principle completely identical
Only one change chmod 777 was for uploads the catalogue.
I had problem with the rights, but it was solved with removal of file .htaccess in uploads catalogue.
I can help you if you write what changes you made in the database and in the script.