FTP文件上载 - 目标文件夹路径错误

时间:2017-06-27 10:38:52

标签: php

$name=$_FILES["uploadfile"]["name"];
$filename=$_FILES["uploadfile"]["tmp_name"];

$ftp_server = "ftp.sitename.com";
$ftp_user_name = "ftpusername";
$ftp_user_pass = "password";

对于LOCAL Apache Web服务器

$destination_file = "/var/www/html/websitefolder/videoupload/"; 

对于实际的Godaddy Apache Web服务器

Try 1: $destination_file = "/public_html/videoupload/";
Try 2: $destination_file = "http://websitename.com/videoupload/";
Try 3: $destination_file = "./videoupload/";
Try 4: $destination_file = "/home/websitename/public_html/videoupload/";

$upload = ftp_put($conn_id, $destination_file.$name, $filename, FTP_ASCII);

当我在本地apache web服务器上传文件时,上面的代码工作正常。但是相同的代码并没有在我真正的godaddy托管apache web服务器上工作。它给出了以下错误...

Warning: ftp_put(): Can't open that file: No such file or directory in /home/websitename/public_html/videoupload/video_upload.php on line 41

所以我猜目标路径错了但不确定什么是正确的路径?请告诉我。

0 个答案:

没有答案