1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Cannot Replace Avatars

Discussion in 'Resolved Bug Reports' started by Shaun Mason, Oct 17, 2010.

  1. Shaun Mason

    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?
  2. Blandt

    Blandt Well-Known Member

    When you say imported .. what do you mean ?
  3. Shaun Mason

    Shaun Mason Active Member

    Sorry, avatars I imported when I pulled content from vBulletin.
  4. Jo.

    Jo. Well-Known Member

    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.
  5. Shaun Mason

    Shaun Mason Active Member

    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.
  6. Blandt

    Blandt Well-Known Member

    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
  7. Shaun Mason

    Shaun Mason Active Member

    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.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
  9. Mike

    Mike XenForo Developer Staff Member

    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.
  10. Shaun Mason

    Shaun Mason Active Member

    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?


Share This Page