Create file target path if it does not exist

This commit is contained in:
chistel 2017-08-16 17:00:19 +01:00 committed by GitHub
parent c4f55fea1c
commit a836c2528e

View File

@ -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;
}
//--------------------------------------------------------------------