Jump to content
MakeWebGames

Host Avatars Locally


CrazyElk

Recommended Posts

2 hours ago, Djkanna said:

It takes a little bit more effort for safety of uploading images, but certainly possible to do. I wrote one for MCCodes that could be converted but I don't think it's still on here now. - if I can find it I will pop it up. 🙂

Your a pal ... cheers.

1 hour ago, Dayo said:

I'll look into this

Thank you, the framework for uploading appears to exist relative to adding modules and themes, occurs to me it may be a relatively simple task to port that to locally storing avatars ... cheers.

Link to comment
Share on other sites

  • 1 month later...

personally in my game i just use for the output to save on database space and get rid of the whole FastImage class also.

public function getProfilePicture() 
{
	$pic = glob("images/avatars/" . $this->info->U_id . ".{jpg,jpeg,png,gif}", GLOB_BRACE);
	$pic = ($pic ? $pic[0] : "images/avatars/default.png");
	return $pic;
}

for the upload i check all file extensions and also i stop any execution in the images directory if this system was to ever fail 

  • Like 1
Link to comment
Share on other sites

13 hours ago, URBANZ said:

personally in my game i just use for the output to save on database space and get rid of the whole FastImage class also.

public function getProfilePicture() { $pic = glob("images/avatars/" . $this->info->U_id . ".{jpg,jpeg,png,gif}", GLOB_BRACE); $pic = ($pic ? $pic[0] : "images/avatars/default.png"); return $pic; }



public function getProfilePicture() 
{
	$pic = glob("images/avatars/" . $this->info->U_id . ".{jpg,jpeg,png,gif}", GLOB_BRACE);
	$pic = ($pic ? $pic[0] : "images/avatars/default.png");
	return $pic;
}

for the upload i check all file extensions and also i stop any execution in the images directory if this system was to ever fail 

I can throw a little PHP code into a .jpg and cURL it to execute whatever I want on your server.
Checking the extension alone is not enough

Link to comment
Share on other sites

Quote

for the upload i check all file extensions and also i stop any execution in the images directory if this system was to ever fail 

this is very true MTG this is why i do extra checks that is just 1 check for file exensions then stop executions in certain directories. but i know what you mean if people fail to do this it is easy to execute code 

Edited by URBANZ
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...