メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Upload::setUploadDir

Set the upload directory

Description​

public boolean Upload::setUploadDir( string $dir )

The directory is created (recursively, mode 0755) when it does not exist. Returns true when the directory is writable, otherwise false and the directory is not set.

When the directory is below the document root and has no .htaccess, one is written that stops scripts from running there (see Introduction). An existing .htaccess is left alone.

Arguments​

NameData typeDefaultRemarks
$dirstringUpload directory

Example​

Controller
use Fegg\Tool\Upload;

$upload = new Upload();
$upload->setUploadDir($this->config['upload_dir']['path']);