Skip to content
Snippets Groups Projects
Commit 9c99a9fb authored by Ludovic Ganée's avatar Ludovic Ganée
Browse files

moveUploadedFile compatible post upload

parent 6a8758a8
No related branches found
No related tags found
No related merge requests found
Pipeline #91242 failed
......@@ -270,14 +270,15 @@ class SessionFiles
*/
public function moveUploadedFile(string $uuid, string $path): bool
{
if ($this->getUri($uuid) === $path) {
$uri = $this->getUri($uuid);
if ($uri === $path) {
$this->sessionRemoveFile($uuid);
return true;
}
if (!is_dir(dirname($path))) {
mkdir(dirname($path), 0777, true);
}
$success = rename($this->uri, $path);
$success = rename($uri, $path);
if ($success) {
$this->sessionRemoveFile($uuid);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment