PhP ftp put error message: failed to open stream

Strugi1991

New Member
Need help. Am trying to upload an image from my local machine (PC) to the FTP server. In return, received the following error:Warning: ftp_put(c:/dhimage/DSC_0067.JPG) [function.ftp-put]: failed to open stream: No such file or directory in /home/dxxx/public_html/ftp/test.php on line 37Cannot uploadHere's my code:\[code\]// get FTP access parameters$host = 'ftp.xxx.com';$user = 'abcxxx';$pass = 'xxxxx';$local_file = 'c:/dhimage/DSC_0067.JPG';$ftp_file = 'DSC_0067.JPG';// open connection$conn = ftp_connect($host) or die ("Cannot initiate connection to host");// send access parametersftp_login($conn, $user, $pass) or die("Cannot login");// perform file upload$upload = ftp_put($conn, $ftp_file, $local_file, FTP_BINARY);// check upload status// display messageif (!$upload) { echo "Cannot upload";} else { echo "Upload complete";}// close the FTP streamftp_close($conn);\[/code\]
 
Back
Top