Fixed  Cannot Replace Avatars

Shaun Mason

Active member
When my members try to replace the avatar's I imported (even I have the problem), I get the following error:

rename(C:\Windows\Temp\php59B7.tmp,C:\inetpub\sites\traditionsportsonline.com\httpdocs\xenforo/data/avatars/l/0/1.jpg) [<a href='function.rename'>function.rename</a>]: File exists

The folders have the appropriate permissions (I think), I imaging the routine should delete the existing file prior to the renaming...anyone have any ideas?
 
As far as I understand there isn't any avatar gallery functionality in xf and members just upload their own avs rather than choose from a set gallery. So maybe that's why you're having trouble trying to import a set of avs from vb.

I was told there was no plan to include this in xf software.
 
As far as I understand there isn't any avatar gallery functionality in xf and members just upload their own avs rather than choose from a set gallery. So maybe that's why you're having trouble trying to import a set of avs from vb.

I was told there was no plan to include this in xf software.

There is an "Import Custom Avatars" option in the vBulletin migration tool. I used that and successfully imported all the avatars that our members used.

What is happening is when someone tries to change to a new avatar, I get the error above.
 
If the import was successful then I do not believe you have permission problems.
I think you have to change the temp folder in your php.ini
Google that and see what you can do

The problem isn't when it writes to the temp file or generates a filename, it is trying to replace the image that exists and it cannot.
 
Just to be sure I did a test import and tried to change my avatar as an imported user. I didn't get any errors when replacing my imported avatar.

The error message appears to indicate a lack of permissions. On Windows servers you can troubleshoot this by setting Everyone = Full Control in the permissions for that folder. Then be sure to propagate the permissions down to all child folders. If that fixes the problem then you know it was a lack of permissions. Then you can reduce the permissions to something more appropriate.
 
This just appears to be a different behavior for rename in Windows and Linux, though interestingly I don't have any problems overwriting my avatar in Windows.

Regardless, I have made a change here.
 
Thanks Mike.

I just figured out the same on my end, editing the Avatar model to use copy instead.

Will a fix been in the next version, or do I need to make notes to do this after I upgrade?

Shaun
 
Top Bottom