Right - let's first try to get the script working by pulling out/amending the bits that do not work....
Firstly we need to find the top document that the server uses to parse addproduct.php. All this means is that if you had my_admin.php that then includes addproduct.php , the top document would be my_admin.php. If you actually have www.yourdoamin.com/admin/addproduct.php
in the url then addproduct is the top document. Now, suss out which folder that document is in (eg addproduct.php would be in /admin/)
Once you've done that, create a new folder in that folder called 'test' and chmod it to 777 (might need ftp for that).
Now the 'get the script working' bit -
If we use relative linking to define the move_to directory within the script, we can easily target our new folder. This is to ensure the upload to /tmp/ bit is working properly.
move_uploaded_file($_FILES['files']['tmp_name'], UploadDir . $_FILES['files']['name']);
and remove the touch() line now. All that did was try to create a blank file as a test.
If you can save the image using relative paths, you should be able to takes the few steps neccessary to get it into the proper folder.
Good luck Sheryll