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
c4f55fea1c
commit
a836c2528e
@ -194,15 +194,15 @@ class UploadedFile extends File implements UploadedFileInterface
|
||||
{
|
||||
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;
|
||||
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