i need to upload a zip from my localhost to my webserver with my codeigniter application.
I have followed the docs but i can’t upload file, the error is:
An Error Was Encountered
Unable to locate the source file. Please check your path.
i can’t figured out why it can’t find the source path, if i try to test the path with file_exists it work, but with the upload method fails…
This is my code:
$this->load->library('ftp');
$config_ftp['hostname'] = 'xxxxx';
$config_ftp['username'] = 'xxxxx';
$config_ftp['password'] = 'xxxxx';
$config_ftp['debug'] = TRUE;
$this->ftp->connect($config_ftp);
if(file_exists($my_file))
echo "ok";
else
echo "no";
$this->ftp->upload($my_file , '/web/'.$my_file, 'binary');
I have used the standard php function for the ftp and now it works