move_uploaded_file()
<p>file1.php - This file gets $_FILES['foto'] and upload it to $Dir_Upload</p>

<pre><code>$Dir_Upload = "httpdocs/upload/";
    ini_set('post_max_size', '8M');
    ini_set('upload_max_filesize', '8M');

....

     if (isset($_FILES['foto']) AND ($_FILES['foto']['size'] != 0) ) {
         $file_temporaneo = $_FILES['foto']['tmp_name'];
        echo  $file_temporaneo;
         $nomefile1 = $_FILES['foto']['name'];
         $estensione_file=estensione($nomefile1);
         $nomefile1=uniqid(file_).".".$estensione_file;
         if (move_uploaded_file($file_temporaneo, $Dir_Upload  . $nomefile1)){
            //echo "Il file è stato caricato";
         } else {
            //print_r(error_get_last());
            echo '&lt;pre&gt;
Your file was not uploaded please try again
here are your debug informations:
'.print_r($_FILES) .'
&lt;/pre&gt;'; 
            //echo "ERROR";
             }
     }else {$nomefile1=NULL;}
</code></pre>

<p>files should be moved from /tmp directory to upload folder. but error
occurs.</p>

<p>/tmp/phpyOFblKhttpdocs/upload/file_4e9c0dd6a9be7.jpg</p>

<p>Array ( [type] => 2 [message] => move_uploaded_file() [function.move-uploaded-file]: Unable to access httpdocs/upload/file_4e9c0dd6a9be7.jpg [file] </p>

<p>httpdocs/upload is set to 0777</p>
