{"record":{"id":"c25906319cefd945","repo":"firefly-iii/firefly-iii","slug":"200000","errorCode":"200000","errorMessage":"200000: File has not been uploaded (yet).","messagePattern":"200000: File has not been uploaded \\(yet\\)\\.","errorType":"exception","errorClass":"FireflyException","httpStatus":500,"severity":"error","filePath":"app/Api/V1/Controllers/Models/Attachment/ShowController.php","lineNumber":84,"sourceCode":"    }\n\n    /**\n     * This endpoint is documented at:\n     * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/attachments/downloadAttachment\n     *\n     * Download an attachment.\n     *\n     * @throws FireflyException\n     */\n    public function download(Attachment $attachment): LaravelResponse\n    {\n        if (true === auth()->user()->hasRole('demo')) {\n            Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));\n\n            throw new NotFoundHttpException();\n        }\n        if (false === $attachment->uploaded) {\n            throw new FireflyException('200000: File has not been uploaded (yet).');\n        }\n        if (0 === $attachment->size) {\n            throw new FireflyException('200000: File has not been uploaded (yet).');\n        }\n        if ($this->repository->exists($attachment)) {\n            $content  = $this->repository->getContent($attachment);\n            if ('' === $content) {\n                throw new FireflyException('200002: File is empty (zero bytes).');\n            }\n            $quoted   = sprintf('\"%s\"', addcslashes(basename($attachment->filename), '\"\\\\'));\n\n            /** @var LaravelResponse $response */\n            $response = response($content);\n            $response\n                ->header('Content-Description', 'File Transfer')\n                ->header('Content-Type', 'application/octet-stream')\n                ->header('Content-Disposition', 'attachment; filename='.$quoted)\n                ->header('Content-Transfer-Encoding', 'binary')","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/firefly-iii/firefly-iii/blob/fd8791d08d4d9e6467519a78048cd038e26b8878/app/Api/V1/Controllers/Models/Attachment/ShowController.php#L66-L102","documentation":"Error \"200000: File has not been uploaded (yet).\" thrown in firefly-iii/firefly-iii.","triggerScenarios":"Thrown at app/Api/V1/Controllers/Models/Attachment/ShowController.php:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fd8791d08d4d9e6467519a78048cd038e26b8878","analyzedAt":"2026-08-17T02:14:53.848Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}