0
我使用服務器上的無法上傳多張圖片IIN的Zend freamework服務器上
Zend框架與上傳mutilply文件的問題,實際上我的代碼工作正常在本地主機,但遠程服務器上它給我的應用程序錯誤消息
我的主人是ipage.com
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->setDestination('projects\\'.$_pId);
// $_pid is my project folder where all files related to it uploded
$files = $upload->getFileInfo();
$i = 1;$g = 1;
foreach ($files as $file => $info)
{
// i have three kinds of images
// innerfinishingphotos_ images which can be more than 1 file eg :innerfinishingphotos_1, innerfinishingphotos_2, innerfinishingphotos_3.
// outerfinishingphotos_ images which can be more than 1 file eg :outerfinishingphotos_1, outerfinishingphotos_2, outerfinishingphotos_3.
// _main_photo image an image.
// here i made if statements to determine which file came from which input file
if($info == $files["innerfinishingphotos_".$i] && $info["name"] == $files["innerfinishingphotos_".$i]["name"] && !empty($info["name"]))
{
$filename = "inner_finishing".$_pId.uniqid().$files["innerfinishingphotos_".$i]["name"];
$upload->addFilter('Rename', $filename, $files["innerfinishingphotos_".$i]);
$photodata = Array ("project_id"=> $_pId, "photo_link"=> "/projects/".$_pId."/".$filename, "photo_name"=> "inner_finishing");
$projectModel->addInProjectGalary($photodata);
$i++;
}
else if($info == $files["outerfinishingphotos_".$g] && $info["name"] == $files["outerfinishingphotos_".$g]["name"] &&!empty($info["name"]))
{
$filename = "outer_finishing".$_pId.uniqid().$files["outerfinishingphotos_".$g]["name"];
$upload->addFilter('Rename', $filename, $files["outerfinishingphotos_".$g]);
$photodata = Array ("project_id"=> $_pId, "photo_link"=> "/projects/".$_pId."/".$filename, "photo_name"=> "outer_finishing");
$projectModel->addInProjectGalary($photodata);
$g++;
}
else if ($info == $files["_main_photo"] && !empty($info["name"]))
{
$filename = "main_photo".$_pId.uniqid().$files["_main_photo"]["name"];
$upload->addFilter('Rename', $filename, $files["_main_photo"]);
$photodata = Array ("project_id"=> $_pId, "photo_link"=> "/projects/".$_pId."/".$filename, "photo_name"=> "project_photo");
$projectModel->addInProjectGalary($photodata);
}
//then i receive the image
if($upload->isValid($file))
{
try {
$upload->receive($file);
}
catch (Exception $e) {
echo "upload exteption";
}
}
}
我測試此代碼和我正常工作在本地主機上,所有圖像上傳和它們的數據進入我的數據庫
但在我的遠程主機'ipage.com'不起作用。
請你們幫我
你會得到什麼錯誤信息? '應用程序錯誤'只是顯示給用戶的用戶友好信息,請檢查錯誤日誌以獲取實際的錯誤信息。 –
我如何得到實際的錯誤?錯誤日誌在哪裏? –
我無法確定導致問題的原因。 –