originalPath = $tmpPath; //php "security" bullshit if (is_uploaded_file($filePath)) move_uploaded_file($filePath, $tmpPath); else copy($filePath, $tmpPath); $this->filePath = $tmpPath; $this->fileName = $fileName; } public function __destruct() { TransferHelper::remove($this->originalPath); } }