只是一個簡單的介紹/背景資料:FTP文件上傳successefully但沒有出現在服務器
這可以被看作是part 2 of my question from yesterday其中@弗雷德-II是非常有益的。我已成功地糾正文件路徑錯誤等
我的問題
如前所述上面,我是成功的文件上傳到服務器(或者至少得到成功消息),但是當我檢查的文件它不在那裏..?事實上,我已經很好地整理了上傳文件的整個服務器,但沒有看到上傳的文件。
所有文件都具有適當的權限,是否有任何可以導致此問題,除了文件權限?
也許我必須在php.ini中更改...但是再次我不會收到上傳成功消息..?
過去有沒有人遇到過這種情況?
$file_upload="true";
$file_up_size=$_FILES['file_up']['size'];
echo $_FILES['file_up']['name'];
if ($_FILES['file_up']['size']>250000){
$msg=$msg."Your uploaded file size is more than 250KB
so please reduce the file size and then upload.<BR>";
$file_upload="false";
}
if (!($_FILES['file_up']['type'] =="image/jpeg" OR $_FILES['file_up']['type'] =="image/gif"))
{
$msg=$msg."Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>";
$file_upload="false";
}
$file_name=$_FILES['file_up']['name'];
if($file_upload=="true"){
$ftp_server = "xxxxxxx";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$ftp_username = "xxxxxx";
$ftp_userpass = "xxxxxx";
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
if($login){
echo '<h1>CONNECTED TO FTP</h1>';
$file = $file_name;
// upload file
if (ftp_put($ftp_conn, $file, 'img/userPics/', FTP_BINARY))
{
echo "Successfully uploaded $file.";
}
else
{
echo "Error uploading $file.";
}
}//if file upload == true
}//if result
// close connection
ftp_close($ftp_conn);
[你應該怎麼做當有人回答你的問題](http:// stackoverflow。com/help/someone-answers)你可以得到積分。 – RiggsFolly