<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Errore funzione ftp_put()]]></title><description><![CDATA[<p dir="auto">Salve ragazzi...sto lavorando alla tesi universitaria, devo realizzare un modulo per il caricamento file via ftp, ma la funziona ftp_put() mi da sempre questo errore:</p>
<p dir="auto">Warning: ftp_put() [function.ftp-put]: Can't open that file: No such file or directory in /web/htdocs/home/uploadftp.php on line 124<br />
2. FTP upload has encountered an error!</p>
<p dir="auto">La connessione avviene, le due cartelle me le crea correttamente, con i permessi 777!</p>
<p dir="auto">Per farlo il codice realizzato è il seguente:</p>
<pre><code class="language-php">//Ricavo dell'id dell'user della sessione corrente! 
         $utente= @mysql_query("SELECT id FROM utenti WHERE  user_id=\"$_SESSION[user111]\"  "); 
         $utente1 = mysql_fetch_array($utente);     
     
        $id=mysql_query("SELECT max(id) FROM progetto") or die (mysql_error()); 
        $id_max=mysql_fetch_array($id); 
        $prog=$id_max[0]+1; 
        //Creo cartella con l'id della tesina! 
        $dir='tesine/'.$utente1[0].'/'.$prog.'/'; 
         
        $old_umask = umask(0);         
        $crea = @mkdir($dir, 0777); 
        umask($old_umask);     

        $filep=$_FILES['file_readme']['tmp_name']; 
        $name=$_FILES['file_readme']['name']; 

set_time_limit(300);//for uploading big files 
     
$paths=$dir; 

$ftp_server='xxxx'; 

$ftp_user_name='xxx'; 

$ftp_user_pass='xxx'; 

// set up a connection to ftp server 
$conn_id = ftp_connect($ftp_server); 

// login with username and password 
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 

// check connection and login result 
if ((!$conn_id) || (!$login_result)) { 
       echo "1. FTP connection has encountered an error!"; 
       echo "Attempted to connect to $ftp_server for user $ftp_user_name...."; 
       exit; 
   } else { 
       echo "Connected to $ftp_server, for user $ftp_user_name"."....."; 
   } 

// upload the file to the path specified 
echo $dir.$name."&lt;br&gt;"; 

$upload = ftp_put($conn_id, $dir.$name, $filep, FTP_ASCII); 

// check the upload status 
if (!$upload) { 
       echo "2. FTP upload has encountered an error!"; 
   } else { 
       echo "Uploaded file with name $name to $ftp_server "; 
   } 

// close the FTP connection 
ftp_close($conn_id);
</code></pre>
]]></description><link>https://dev.connect.gt/topic/138970/errore-funzione-ftp_put</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 14:18:05 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/138970.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Nov 2010 16:39:18 GMT</pubDate><ttl>60</ttl></channel></rss>