PHP Chmod help please?

Mel

New member
On my cms I have file upload system but when files are uploaded using it they have a permission of 0600 which prevents the files from being seem on the website
I have tried to chmod the files and cannot seem to get it to work.

I have an array which calls the file name from a database and then ive tried to convert the file but dont understand why its not working.

<?php


$result = @mysql_query('SELECT * FROM tbl_images');

if (!$result) {
exit('<p>Error Performing Query: ' . mysql_error() . '</p>');
}


while ($row = mysql_fetch_array($result)) {

echo 'chmod("images/' . $row['filename'] . '",0644);'

I can get it to work if i just have
<?php chmod("images/photo18.jpg",0644); ?>

but thats no use as I cant predict the file names for every file that may be uploaded.

Any help would be greatly appreciated TY
even without the echo it still isnt working
 
Back
Top