boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bug fix - chmod on uploading images

 
Post new topic   Reply to topic    boardom Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
bootle



Joined: 18 Apr 2004
Posts: 3

PostPosted: Sun Apr 18, 2004 9:41 am    Post subject: bug fix - chmod on uploading images Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Bugs All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group