How can I change the directory from /tmp to a different directory
I am new t开发者_StackOverflow中文版o PHP and am trying to learn it by myself using ZEND. I need to upload a file to our iSeries but it keeps putting the file into the /tmp directoy. I want it to go into the /Labphotos directory. I found code on the interent that is uploading the file but not to the directory I set in the "SetDestination" variable. Here is a snippet of the code I am using
$file = new Zend_File_Transfer_Adapter_Http();
$file->setDestination('/labphotos');
try {
// upload received file(s)
$file->receive();
} catch (Zend_File_Transfer_Exception $e) {
print $e->getMessage();
}
It might be a security feature that is preventing you from doing this. It is not uncommon to restrict execution of files in the tmp directory, and to redirect all uploads to the tmp directory. This prevents someone from uploading a malicious script, then executing it under the httpd account by requesting it.
Your iseries system admin ought to be able to clear that up for you.
Please use full path instead of relative path:
$file->setDestination('/labphotos');
精彩评论