Avatar not showing using upload from user machine

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
JediKnight2
Registered User
Posts: 37
Joined: Mon Sep 09, 2002 8:18 pm

Re: Avatar not showing using upload from user machine

Post by JediKnight2 »

Glad you got it working...this isn't the case for me though...I did a fresh install with NOTHING...tried to upload an avatar and .... NADA
Flagg
Registered User
Posts: 10
Joined: Thu Mar 20, 2003 10:20 pm

Re: Avatar not showing using upload from user machine

Post by Flagg »

JediKnight2 wrote:Well crap...I am having the EXACT same issue....I was running the newest version of PHPBB2 installed the newest version of PHPBB3, ran the converter and everything is fine except for avatars...they worked BEFORE I did the conversion as I tested that to ensure folder permissions were ok...this happened AFTER I ran the converter. This is how it looks in code when it is pointing to the image..the image is in there

./download/file.php?avatar=2_1219363705.jpg

Also when I go to change the avatar the code points to

./download/file.php?avatar=2_1219363705.jpg but the name in the upload folder is f96dc530ae6064981b43d36524aabfee_2.jpg
I'm not sure what the correct filenaming convention is, but it is intentionally obfuscated so people don't know the actual filename, so this doesn't necessarily mean anything although I personally have no idea if this is the right naming convention or not.
JediKnight2 wrote: Just to throw in information on my setup...

Your board's URL:
Version of phpBB3: 3.03
Fresh Install
Used nothing other than files provided with phpBB3. zip file to install
MODs you have installed: NONE on PHPBB3...I DO have some on the 2.0.23 board
When the problem started: After the conversion from PHPBB 2.0.23
Your level of expertise (be honest): Intermediate to Advanced

Template(s) used: prosilver, subsilver2
Language(s) used: English
Version of PHP used: 4.3.9
Database and version used: MySQL 4.1.20
I had a similar setup, no mods on the PHPBB3.02, but a few on the PHPBB 2.023 - mainly the attachment mod, the upload picture mod are the 2 I think might affect this.

Both of my WAMP and my Linux box where using 5.x versions of PHP and MySQL
JediKnight2
Registered User
Posts: 37
Joined: Mon Sep 09, 2002 8:18 pm

Re: Avatar not showing using upload from user machine

Post by JediKnight2 »

I just tried it AGAIN...fresh install..I even deleted the database COMPLETELY instead of just deleting the tables...still...NOTHING...it's starting to get frustrating... :evil:

The settings within the ACP have to be right because offsite avatars and gallery avatars work fine...

This is Linux with CentOS 4.6, Apache...I have checked EVERY log tied to Apache...apaches logs, mod_sec logs...everything and NOTHING in the PHPBB3 folder is tripping anything.
JediKnight2
Registered User
Posts: 37
Joined: Mon Sep 09, 2002 8:18 pm

Re: Avatar not showing using upload from user machine

Post by JediKnight2 »

maybe this well help

NVM
Last edited by JediKnight2 on Sat Aug 23, 2008 8:58 pm, edited 1 time in total.
JediKnight2
Registered User
Posts: 37
Joined: Mon Sep 09, 2002 8:18 pm

Re: Avatar not showing using upload from user machine

Post by JediKnight2 »

Well...I paid someone to fix it and I would like to know from SOMEONE in the know with PHPBB3...why this would happen...

The fix was in the file.php file...the original code starting on line 405

Code: Select all

		if (@readfile($file_path) === false)
		{
			$fp = @fopen($file_path, 'rb');

			if ($fp !== false)
			{
				while (!feof($fp))
				{
					echo fread($fp, 8192);
				}
				fclose($fp);
			}
		}

		flush();
Replace that with

Code: Select all

    echo file_get_contents($file_path);
That fixed it for me...now the question is why...the reason I got was there was a php error on the line
$fp = @fopen($file_path, 'rb'); and that returned false and the script returned to browser zero

SO IF it is a php error...how come everyone else isn't having an issue here? Is it because of a server setting on my end?
elevul
Registered User
Posts: 13
Joined: Wed Aug 27, 2008 3:46 pm

Re: Avatar not showing using upload from user machine

Post by elevul »

Same problem.
As I can see the avatar is being uploaded, but with another name, while the browser asks at the file.php file to view the original name of the avatar.


Your board's URL: http://pescatoritaliani.helloweb.eu/forum/ ( the board is currently down for maintenance)
Version of phpBB3: 3.0.2
Was this a fresh install or a(n) update/upgrade/conversion (please be specific)? Fresh install of the 3.0.0, without problems. Deleted the forum root directory by error, so I directly downloaded the 3.0.2 install zip and extracted it on the server, and then edited the config file with the DB details.
Did you use an automated wizard provided by your host to install phpBB? Yes, I used an automated wizard provided by my host the first time, but not the second time.
MODs you have installed: Nothing on this board. Installed a mod to avoid redirecting pages on the 3.0.0
When the problem started: Immediately after "installing" the 3.0.2
Your level of expertise (be honest): Can't code. Can't understand php, but I have experience with boards( IPB and vBulletin). First time with a phpBB.

Additionally, you may wish to provide the following (where applicable)
Template(s) used: prosilver, subsilver2, mg_autumn
Language(s) used: English, Italian
Version of PHP used: 5.2.6-3
Database and version used: MySQL5
petertb
Registered User
Posts: 18
Joined: Fri Jul 02, 2004 4:32 pm

Re: Avatar not showing using upload from user machine

Post by petertb »

JediKnight2 wrote:Well...I paid someone to fix it and I would like to know from SOMEONE in the know with PHPBB3...why this would happen...

The fix was in the file.php file...the original code starting on line 405
Mine started on line 382

This DID NOT fix it for me! :cry: :?:

Oh well, have try something else I guess.
Thanks JediKnight2!!!

Peter

p.s. Image Properties after trying above-mentioned fix:

Code: Select all

Location: http://localhost/phpBB3/download/file.php?avatar=2_1220219567.jpg
Image dimensions: 0px × 0px (scaled to 200px × 149px)
Size of File: 7.87 KB (8056 bytes)
Alternate Text: User avatar
File size and dimensions (SCALED) are correct, but still can't see image!!
necknime
Registered User
Posts: 1
Joined: Mon Sep 22, 2008 12:51 pm

Re: Avatar not showing using upload from user machine

Post by necknime »

I got the same problem.

I found following solution.
Check the permissions at ./download directory and file.php.
Permissions must be set as your webserver account. Owner for directory must be same as apache user (www-data in Debian).
This works for me.

J
lupus_est
Registered User
Posts: 9
Joined: Fri May 16, 2008 6:07 pm
Location: Split, Croatia

Re: Avatar not showing using upload from user machine

Post by lupus_est »

JediKnight2 wrote:Well...I paid someone to fix it and I would like to know from SOMEONE in the know with PHPBB3...why this would happen...

The fix was in the file.php file...the original code starting on line 405

Code: Select all

		if (@readfile($file_path) === false)
		{
			$fp = @fopen($file_path, 'rb');

			if ($fp !== false)
			{
				while (!feof($fp))
				{
					echo fread($fp, 8192);
				}
				fclose($fp);
			}
		}

		flush();
Replace that with

Code: Select all

    echo file_get_contents($file_path);
That fixed it for me...now the question is why...the reason I got was there was a php error on the line
$fp = @fopen($file_path, 'rb'); and that returned false and the script returned to browser zero

SO IF it is a php error...how come everyone else isn't having an issue here? Is it because of a server setting on my end?
Hey man, thanks you very much, this helped to me too. I guess someone must tell this to people in phpbb to include in new update or phpbb4. :mrgreen:
Thanks again, bye.... :)
User avatar
elephantspike
Registered User
Posts: 192
Joined: Thu Oct 13, 2005 6:08 am
Location: Fort Lauderdale, FL
Contact:

Re: Avatar not showing using upload from user machine

Post by elephantspike »

I'm having this exact same problem.

I've done the code edit above to file.php. Am I supposed to re-install and reconvert phpBB3 now in order to make this work?
User avatar
elephantspike
Registered User
Posts: 192
Joined: Thu Oct 13, 2005 6:08 am
Location: Fort Lauderdale, FL
Contact:

Re: Avatar not showing using upload from user machine

Post by elephantspike »

OK, I solved my problem. Solution posted here:

http://www.phpbb.com/community/viewtopi ... &t=1316105
grandrake
Registered User
Posts: 3
Joined: Sat Jul 30, 2005 6:40 am

Re: Avatar not showing using upload from user machine

Post by grandrake »

lupus_est wrote:
JediKnight2 wrote:Well...I paid someone to fix it and I would like to know from SOMEONE in the know with PHPBB3...why this would happen...

The fix was in the file.php file...the original code starting on line 405

<-- code skipped -->

That fixed it for me...now the question is why...the reason I got was there was a php error on the line
$fp = @fopen($file_path, 'rb'); and that returned false and the script returned to browser zero

SO IF it is a php error...how come everyone else isn't having an issue here? Is it because of a server setting on my end?
Hey man, thanks you very much, this helped to me too. I guess someone must tell this to people in phpbb to include in new update or phpbb4. :mrgreen:
Thanks again, bye.... :)
Well, ran into this problem today - everything had been working fine before. As I ran two phpbb3 forums on the same server and both encountered the same issue, I suspected it was due to a change on the server end by the admins.

Applied the workaround, and it worked, thanks. Here's the error_log entry I got when I reverted to the original code and enabled the capturing of error messages (remove the "@" before the "readfile" function call):
[06-Dec-2008 03:21:18] PHP Warning: readfile() has been disabled for security reasons in /blahblahblah/download/file.php on line 386
That perhaps is the issue. Quick check with phpinfo() showed that my server admin had disabled readfile (isn't it great when admins change things but don't inform anyone about it?). More info here for those interested: http://www.nusphere.com/kb/phpmanual/fe ... e-mode.htm
BLeeN
Registered User
Posts: 1
Joined: Tue Dec 09, 2008 1:06 pm

Re: Avatar not showing using upload from user machine

Post by BLeeN »

Also, if you have used the convert tool, the avatar filename in the is the same as the real filename in your avatar upload directory.
This is incorrect.
The actual filename is correct, but you need to change the user_avatar column to userID_unixtimestamp.fileext
Doesn't matter what the exact timestamp is, as long as it's valid.
Locked

Return to “[3.0.x] Support Forum”