mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Create file target path if it does not exist
This commit is contained in:
parent
dfae43da6a
commit
c4f55fea1c
@ -190,19 +190,19 @@ class UploadedFile extends File implements UploadedFileInterface
|
||||
* the set path does not exist
|
||||
* @return string The path set or created.
|
||||
*/
|
||||
protected function setPath($path)
|
||||
{
|
||||
if (!is_dir($path))
|
||||
{
|
||||
mkdir($path, 0777, true);
|
||||
//create the index.html file
|
||||
if (!file_exists($path.'index.html'))
|
||||
{
|
||||
$file = fopen($path.'index.html', 'x+');
|
||||
fclose($file);
|
||||
}
|
||||
}
|
||||
return $path;
|
||||
protected function setPath($path)
|
||||
{
|
||||
if (!is_dir($path))
|
||||
{
|
||||
mkdir($path, 0777, true);
|
||||
//create the index.html file
|
||||
if (!file_exists($path.'index.html'))
|
||||
{
|
||||
$file = fopen($path.'index.html', 'x+');
|
||||
fclose($file);
|
||||
}
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user