private function generateFilename($path, $extension)
    {
        $file = '';

        while (!$file || is_file($path.$file)) {
            $file = uniqid().'.'.$extension;
        }

        return $file;
    }