Unable to locate the source file. Please check your path Unable to locate the source file. Please check your path codeigniter codeigniter

Unable to locate the source file. Please check your path


Instead this

$this->ftp->upload('C:\Users\SYSTEM2\Desktop\checking\ash.jpg\' ,  base_url().'uploads/myfolder/ash.jpg/');

use

 $this->ftp->upload('C:\Users\SYSTEM2\Desktop\checking\ash.jpg','/www/uploads/myfolder/ash.jpg');

But you should know the root path in your ftp server, sometimes it "/www/yourdomen/".


Try $this->ftp->upload('C:/Users/SYSTEM2/Desktop/checking/ash.jpg' , '/www/uploads/myfolder/'); it is working for me best of luck


Codeigniter ftp class check if the file exists first then perform the upload you take a look at the code in codeigniter folder system\libraries\FTP.php line 238

if ( ! file_exists($locpath)){ $this->_error('ftp_no_source_file'); return FALSE;}

According to php.net site you local file path should be in the form //computername/share/filename if you use file_exists with local files outside your web server.

which means you must put the file in a shared folder with public permissions.

if you set that correct and make sure that permissions allow users from network to access that file then may be it could work .

I recommend using a form instead of writing the file path manually then you can write your code like:

$file=$_FILES["userfile"]["name"];$this->ftp->upload($file ,  './upload','ascii', 0775);