bootle
Joined: 18 Apr 2004 Posts: 3
|
Posted: Sun Apr 18, 2004 9:41 am Post subject: bug fix - chmod on uploading images |
|
|
b2upload.php needs a tweak so that uploaded files are chmod'ed to a suitable value for loading back into the browser
it has been reported before (in the how-to) forum and the fix provided by IanH. However, the fix hasn't reached the latest b2 version at the time of writing.
maybe it does not apply to all systems, otherwise it would have been spotted earlier - but a number of people have reported the same prob
and yes, I had chmod the images directory to 777
here's the fix
if (!strlen($imgalt)) {
move_uploaded_file($img1, $pathtofile)
or die("Couldn't Upload Your File to $pathtofile."); //Path to your images directory, chmod the dir to 777
chmod($pathtofile,0744) // chmod on the image itself, so can be read back
or die("Couldn't Upload Your File to $pathtofile.");
} else {
rename($img1, $pathtofile)
or die("Couldn't Upload Your File to $pathtofile.");
}
in other words, the key is to chmod the file itself when uploading |
|