Jump to content
MakeWebGames

Recommended Posts

Posted

Howdy,

I note there is no provision to host avatar image files locally, apart from the answer "to save server space" is there any valid reason?

Is there a module available to perform this task or is anyone contemplating writing one?

Cheers.

Posted

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. 🙂

Posted
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.

  • 1 month later...
Posted
On 1/26/2021 at 7:08 AM, CrazyElk said:

@Dayo has now implemented this into my game, great job thank you. 😀

Glad you got it sorted... and sorry I totally forgot about it ( someone needs to constantly poke me for me to do things next time 🙂 ) 

  • Like 1
Posted

Some simple checking if allowed file type is attempting to be uploaded then check if file type is valid is basically all that needs to b3 done.

  • Like 1
Posted

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
Posted
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

Posted (edited)
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

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...