Here is how I do
jimport('joomla.client.ftp');
$app =& JFactory::getApplication();
$host = $app->getCfg('ftp_host');
$port = $app->getCfg('ftp_port');
$options = null;
$user = $app->getCfg('ftp_user');
$pass = $app->getCfg('ftp_pass');
$root = $app->getCfg('ftp_root');
$ftp = JFTP::getInstance($host, $port, $options, $user, $pass);
$file_1 = date('YmdHis').'-'.$autore.'-'.$titolo.'-1c1.jpg';
//code to chenge dir and create folder if not existing (this code works)
//I've checked the correct position printing $ftp->pwd()
//upload file
$upload = $ftp->store($files['file1']['tmp_name'], $file_1);
//$files['file1']['tmp_name'] contains the path and name for the uploaded file: /tmp/phpQfBT6o
exit(print_r($upload)); //this says 1, so the store should succeed, but inside the folder there isn't the file
Which is the problem? Maybe it is not correct to specify the temp file?How do I have to do to correctly upload the file?


Sign In
Create Account


Back to top









