Avatar uploading - missed extensions [message #31365] |
Wed, 19 April 2006 06:51 |
alexeik
Messages: 4 Registered: April 2006 Location: SPb, Russia
Karma: 0
|
Junior Member |
|
|
Hello
I'm using last release (2.4.7) and have a problem with uploading custom user avatars.
All going right while select, preview and upload files
but after that files with avatars and their names in db miss extensions. That's wrong and how could I fix it?
BTW, Uploading files in forum posts works fine.
Alexei
|
|
|
Re: Avatar uploading - missed extensions [message #31382 is a reply to message #31365] |
Wed, 19 April 2006 20:43 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Works fine on my development forum and this very forum as well. What version of PHP are you using? Do the avatars on disk have the extension?
FUDforum Core Developer
|
|
|
Re: Avatar uploading - missed extensions [message #31387 is a reply to message #31382] |
Thu, 20 April 2006 07:15 |
alexeik
Messages: 4 Registered: April 2006 Location: SPb, Russia
Karma: 0
|
Junior Member |
|
|
PHP Version 4.3.3
No file extensions on disk aswell.
After selecting avatar file on my computer and click "preview"
I got this code
<tr class="vt RowStyleA"><td>Файл с картинкой: <br /><span class="ErrorText">Указанная вами ссылка URL не содержит картинки</span></td><td><table border=0 cellspacing=0 cellpadding=0><tr><td><img src="index.php?t=tmp_view&img=691.__0opmGk" width="72" height="28" /></td><td> <input type="submit" class="button" name="btn_detach" value="Удалить картинку"></td></tr></table></td></tr>
<input type="hidden" name="avatar_tmp" value="NjkxLl9fMG9wbUdrCjAKMA==">
[Updated on: Thu, 20 April 2006 07:41] Report message to a moderator
|
|
|
|
|
Re: Avatar uploading - missed extensions [message #31424 is a reply to message #31403] |
Fri, 21 April 2006 14:21 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
It sounds like getimageinfo() does not return expected information. Try to add debug code to the fetch_img() function inside register.php and see what is the contents of the $img_info array.
FUDforum Core Developer
|
|
|
Re: Avatar uploading - missed extensions [message #31448 is a reply to message #31424] |
Mon, 24 April 2006 09:00 |
alexeik
Messages: 4 Registered: April 2006 Location: SPb, Russia
Karma: 0
|
Junior Member |
|
|
Ok, I've solved the problem
changing register.php code to this
if (DIRECTORY_SEPARATOR == '/')
{ /* *nix */
$ext = array(1=>'gif', 2
=>'jpg', 3=>'png', 4=>'swf');
$img_info = getimagesize($TMP . $common_av_name);
$av_path = 'images/custom_avatars/'.substr($common_av_name, 0, strpos($common_av_name, '_')).$ext[$img_info[2]];
} else {
i.e. $av_path = 'images/custom_avatars/'.substr($common_av_name, 0, strpos($common_av_name, '_')).$ext[$img_info[2]];
have been missing file extensions
but now i afraid that after forum update this will not work again.
|
|
|
Re: Avatar uploading - missed extensions [message #31510 is a reply to message #31448] |
Tue, 02 May 2006 02:05 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
I think the problem lies with the tempnam() function on your system.
Can you try the following bit of code:
<?php var_dump(
tempnam("/tmp/", "foo.gif__")
); ?>
FUDforum Core Developer
|
|
|