I have a problem with a script on my server which is uploading a file.

Everything is fine for file sizes under 1MByte, but over 1MByte the file uploads to the temp directory but won't copy using the following code:

if (move_uploaded_file($userfile, "../../files_cms/".date("Y")."/".date("m")."/".date("d")."/".$savefilename)) {
echo "copied successfully<br>";
} else {
echo "ERROR: couldn't copy file !<br />";

I alway get the error for files over 1 MByte.

I've set max upload size to 4M, max POST to 8M, memory to 12M and execution time to 300 with no change.

Anyone got any ideas?