FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Avatar uploading - missed extensions
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Avatar uploading - missed extensions [message #31365] Wed, 19 April 2006 06:51 Go to next message
alexeik is currently offline  alexeik   Russian Federation
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
alexeik is currently offline  alexeik   Russian Federation
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>&nbsp;<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 #31393 is a reply to message #31387] Thu, 20 April 2006 13:29 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
That looks fine to me, have you tried submitting the form and seeing what gets uploaded to your server?

FUDforum Core Developer
Re: Avatar uploading - missed extensions [message #31403 is a reply to message #31393] Fri, 21 April 2006 07:49 Go to previous messageGo to next message
alexeik is currently offline  alexeik   Russian Federation
Messages: 4
Registered: April 2006
Location: SPb, Russia
Karma: 0
Junior Member
After form submiting
file upload to custom_avatars dir without extension
an in fud26_table avatar_loc field becomes like this
<img src="http://mysite.ru/forum/images/custom_avatars/691." width="75" height="56" />
Re: Avatar uploading - missed extensions [message #31424 is a reply to message #31403] Fri, 21 April 2006 14:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
alexeik is currently offline  alexeik   Russian Federation
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 Go to previous message
Ilia is currently offline  Ilia   Canada
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: V 2.7.4, msg error compiling pre_reg template
Next Topic: every user can delete/modify all posts, edit/delete permission set to "no"
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 20:30:35 GMT 2024

Total time taken to generate the page: 0.02272 seconds