简体   繁体   中英

How can I change the directory from /tmp to a different directory

I am new to 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.

请使用完整路径而不是相对路径:

$file->setDestination('/labphotos');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM