News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Uploaded avatars have tmp extension

Started by Lon, October 30, 2014, 01:49:47 PM

Previous topic - Next topic

Lon

Hello, newbie here. Just installed latest version, info as follows:

Version Information:
Forum version: SMF 2.0.9 (more detailed)
Current SMF version: SMF 2.0.9
GD version: bundled (2.1.0 compatible)
MySQL version: 5.6.12-log
PHP: 5.3.26
Server version: Microsoft-IIS/8.0

When I upload photos of any size for an avatar, they're created with a "tmp" extension (avatar.jpg.tmp). When I remove the tmp extension, the photo/avatar loads fine. What is creating the tmp extension and how do I get it to not create it? I searched the forums here but found topics with no resolution.

Thanks for any help!

Arantor

SMF is creating the tmp extension because they're temporary files.

Something is preventing them being moved into their final resting place with proper filename. Could be file permissions, could be something weird with IIS since I don't think anyone's tested on IIS 8.

The avatars are not supposed to be called directly with .tmp files in them, however...

Lon

Thanks. The final resting place I believe is where the tmp file is because when I remove the tmp extension, the file works fine for the avatar on the forums. It even gets properly resized with GD. I have Write permission on both the 'avatars' and 'uploaded' avatars directories. I created 'uploaded' as a child from the original 'avatars' directory for uploaded avatar files. I've also tried uploading with the default directory of avatars before creating the child and got the error as well. I failed to mention in my previous post that even though the file uploaded and got resized, I get the following error: "The avatar you have selected is either too large or not an avatar."

Arantor

Um... no. Just no. That's definitely not correct since there is no situation where you would get that filename as the ACTUAL filename.

If you're using the attachments folder for storing avatars, you would get a filename with an md5 hash in it. If you were using a separate avatars folder, you would have avatar_(user_id)_(timestamp).jpg as the filename.

The .tmp extension is added when it is first uploaded, before being resized, and it gets resized when it is moved. I know, because I worked on that code in 2.0.6. I already guessed you were getting that error, the question then just becomes why you are getting that error... and why SMF isn't re-pruning the file again afterwards because it should never be leaving the .tmp file laying around (because that was one of the things I tweaked in 2.0.6, at least I thought I did because it's a security risk otherwise)

Can you upload one of the files here as an attachment for me to take a look at please?

Lon

Sorry, the name of the avatar above was just something I typed because I couldn't remember the actual filename.

I did a new file upload as an avatar and I'll post the resultant images to this post. Again, same error as above. First I'll attach the raw image that I uploaded and then the 2 files that SMF created. BTW, the directory that the files are being created in, is: /forum/avatars/uploaded, which is what I have configured in Avatar Settings under Attachments and Avatars.

Arantor

I suspect that's actually your problem. Is the *actual* path /forum/avatars/uploaded/ ? Because that would be strange if it is - the path you see in FTP is not the real path.

Take a look, for example in Admin > Configuration > Server Settings at the various paths such as the one for the sources directory, in your case that's probably C:\inetpub\forum\ or something similar.

You'll need to put the actual path to the avatars in there so the software can move it.

Lon

This is what they are now:

Avatars directory: E:\hosted\cust648\mydomain.com\wwwroot\forum\avatars
Avatars URL: hxxp:www.mydomain.com/forum/avatars [nonactive]

Should they be:


Avatars directory: E:\hosted\cust648\mydomain.com\wwwroot\forum\avatars\uploaded
Avatars URL: hxxp:www.mydomain.com/forum/avatars/uploaded [nonactive]

Arantor

No, there's two separate avatars directories.

There's the one for the gallery of avatars - which is what the /avatars folder is.
Then there's the one for uploaded avatars - which also really shouldn't be inside /avatars/ at all.

Lon

...still trying to get this figured out.  :(

Arantor

Well, considering that I provided information that seemed relevant but it wasn't acted on...?

Advertisement: