Heres my code:
$host = 'ftp.uscdls.com';
$usr = 'something';
$pwd = 'something';
$local_file = 'img.png';
$ftp_path = '/www.something.com';
$conn_id = ftp_connect($host, 21) or die ("Cannot connect to host");
ftp_pasv($conn_id, true);
ftp_login($conn_id, $usr, $pwd) or die("Cannot login");
// perform file upload
ftp_chdir($conn_id, 'load_uploads');
$upload = ftp_put($conn_id, $ftp_path, $local_file, FTP_ASCII);
if($upload) { $ftpsucc=1; } else { $ftpsucc=0; }
// check upload status:
print (!$upload) ? 'Cannot upload' : 'Upload complete';
print "
";
// close the FTP stream
ftp_close($conn_id);
It's failing on the line where it ouputs "Cannot Upload". Ive rewritten this a couple times and i keep getting the same error. Hoping someone has a better set of eyes on this. Again so appreciated for any help!! thanks!