1

Topic: Avatar Problems

Ok people, im having problems getting my avatars to even show on the selection screen and im having problems uploading them through the forums too. It always comes up with the error;

The server was unable to save the uploaded file. Please contact the forum administrator at dominic.ryles@bibbydist.co.uk.

How come it keeps on coming up with this? I have CHMOD'ed the folder to accept anything yet it still doesnt allow them. Could someone PLEASE help me?

Kind Regards,
Dominic

Re: Avatar Problems

Well, we could do a little trial and error. First, open up profile.php and go to line 342. It looke something like this:

$temp = @move_uploaded_file($uploaded_file['tmp_name'], $options['avatars_dir'].'/'.$id.'.gif');

There, remove the @ in front of move_uploaded_file. Do the same on lines 348 and 354. Then try uploading a file again and see if PHP outputs a warning. If it does, paste it here.


If that doesn't work, we'll try the following. Go to line 359. It looks something like this:

if (!$temp)

Before that line, enter:

dump($uploaded_file);

Then paste here what is outputted on the screen when you try to upload.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Avatar Problems

Good day.

I have the same problem with avatars.
I tried to solve it as you describe, but it doesnt work.

Here's the message i receive when try to upload avatar:

Array
(
    [name] => pirat2.gif
    [type] => image/gif
    [tmp_name] => /tmp/phpOzqGjc
    [error] => 0
    [size] => 301
)

How can i fix this problem?

Tx.

Re: Avatar Problems

Remove the @ before move_uploaded_file on lines 342, 348 and 354. Try again and then paste the error message you get here.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Avatar Problems

Here you go:

Warning: move_uploaded_file(avatars/3.gif): failed to open stream: Permission denied in /vhosts/kma.alania.net/html/punbb/profile.php on line 342

Warning: move_uploaded_file(): Unable to move '/tmp/phpseVWQk' to 'avatars/3.gif' in /vhosts/kma.alania.net/html/punbb/profile.php on line 342

maybe there's chmod problems? but i tried all of them, and it still doesnt work.

Re: Avatar Problems

Yeah, it's a permission problem. I don't know anything about your server, so it's hard to tell you what to do. I usually set the webserver user as owner of the avatar directory and chmod it to 755.

chown nobody:nobody avatars
chmod 755 avatars

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7

Re: Avatar Problems

chmod for avatar direcrory is already set to 755...

still having problems...

Re: Avatar Problems

Yeah, but who owns the directory? If you don't know how to change the owner, try chmodding it to 777.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9

Re: Avatar Problems

Thank you, Kennel! smile

Solve this problem as u say smile

10

Re: Avatar Problems

When I upload avatars, it uploads them chmod 666. How do i make them upload to chmod 755 or anything readable. My avatars folder is 777. Help, and also how do you assign a mod to a forum??

Re: Avatar Problems

Have a look in this topic. Gribber posted some code that will be in 1.1. You have to manually edit profile.php.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

12

Re: Avatar Problems

and what line do i put this code??

Re: Avatar Problems

Search for "@unlink($options['avatars_dir'].'/'.$id.'.jpg');" and I think you will find it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Avatar Problems

Hy there!

I have a problem.
Use 1.2.9 forum, but the upload avatars is not working.
Set the options and set the directory permissons, but if i want use avatars upload is sent the error. No selected file.
What is wrong.