我有一個名爲「Mobile_App」的文件夾,該文件夾是一個包含文件輸入,上傳文件的php腳本和稱爲「ImageFiles」的文件夾的html頁面。這個上傳腳本是否正確?
問題是文件沒有被上傳到「ImageFiles」中。我想知道的是,當將文件上傳到「Imagefiles」文件夾時,下面的代碼是正確的,還是不正確,我如何才能使它正常工作?
下面是PHP腳本上傳文件(文件輸入被稱爲「fileImage」):
<?php
$destination_path = $_SERVER['DOCUMENT_ROOT']."/ImageFiles";
$result = 0;
$target_path = $destination_path . basename($_FILES['fileImage']['name']);
if(move_uploaded_file($_FILES['fileImage']['tmp_name'], $target_path)) {
$result = 1;
}
sleep(1);
?>
那麼運行腳本時會發生什麼? – acrosman 2012-04-12 18:08:51
當我運行腳本時,它只是一個空白頁 – user1324106 2012-04-12 18:11:50
你試過'error_reporting()'? – 2012-04-12 18:20:32