# Php -\> image upload problem

**URL:** <https://forum.kirupa.com/t/php-image-upload-problem/195576>\
**Category:** Uncategorized\
**Created:** [August 1, 2006, 5:59pm UTC](https://forum.kirupa.com/t/php-image-upload-problem/195576 "2006-08-01T17:59:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MyDNA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MyDNA](https://forum.kirupa.com/u/MyDNA)\
**Post date:** [August 1, 2006, 5:59pm UTC](https://forum.kirupa.com/t/php-image-upload-problem/195576/1 "2006-08-01T17:59:33Z")

</div>

while learning PHP i started to build a cms sytem for my flash website.  
after a lot of trying, de-bugging and so on i finished my news item with uploading images.  
That works fine. After that i thought it would be helpfull if an uploaded image resizing itself to 50x50 pixels. So i looked at [php.net](http://php.net) and in google for a good script. I found a couple but because my php knowlegde is in some ways still like a beginner.

i have this function for uploading the images:

```php

function afbUpload ($file, $fileName)
	{
		if (is_uploaded_file ($file["tmp_name"] ) )
		{
			if (move_uploaded_file ($file["tmp_name"], "/var/www/vhosts/it-bone.nl/httpdocs/include/images/nieuws/" . $fileName . ".jpg" ) )
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}

```

now i try to look for a code to change the size to 50x50 pixels but i don’t know where to start and where to add the code. Does someone can give me a hint or help me reaching my goal.

Kind regards Jos:ninja: :crazy: :stare:
