Closed LordHelmchen666 closed 4 months ago
There needs to be a full path in create and write to work . Just tested on my system with changed code to
$dest = $params->get('general_upload') . DIRECTORY_SEPARATOR . $subfolder . DIRECTORY_SEPARATOR;
$index = '<html><body></body></html>';
if(!is_dir($dest))
{
\Joomla\Filesystem\Folder::create(JPATH_ROOT . DIRECTORY_SEPARATOR . $dest, 0755);
\Joomla\Filesystem\File::write(JPATH_ROOT . DIRECTORY_SEPARATOR . $dest . DIRECTORY_SEPARATOR . 'index.html', $index);
}
$dest .= $date . DIRECTORY_SEPARATOR;
if(!is_dir($dest))
{
\Joomla\Filesystem\Folder::create((JPATH_ROOT . DIRECTORY_SEPARATOR . $dest, 0755);
\Joomla\Filesystem\File::write((JPATH_ROOT . DIRECTORY_SEPARATOR . $dest . DIRECTORY_SEPARATOR . 'index.html', $index);
}
$filename = $time . '_' . md5($file['name']);
$dest .= \Joomla\Filesystem\File::stripExt($filename) . '.' . $ext;
if(\Joomla\Filesystem\File::upload($file['tmp_name'], JPATH_ROOT . DIRECTORY_SEPARATOR . $dest))
When open_basedir is set in PHP config then upload fails. If i do not set then upload works.
could not save. Error: Joomla\Filesystem\Folder::create: Path not in open_basedir paths
I think it is this code components/com_joomcck/fields/image/image.php from line 176