{"record":{"id":"ae804b0aafc9d857","repo":"krayin/laravel-crm","slug":"could-not-create-temporary-files-for-attachments-ae804b","errorCode":null,"errorMessage":"Could not create temporary files for attachments. Your tmp directory may be unwritable by PHP.","messagePattern":"Could not create temporary files for attachments\\. Your tmp directory may be unwritable by PHP\\.","errorType":"exception","errorClass":"\\Exception","httpStatus":null,"severity":"error","filePath":"packages/Webkul/Email/src/Helpers/Parser.php","lineNumber":732,"sourceCode":"                $written = 0;\n\n                while ($written < $len) {\n                    $write = $len;\n                    $part = fread($this->stream, $write);\n\n                    fwrite($temp_fp, $this->decodeContentTransfer($part, $encodingType));\n\n                    $written += $write;\n                }\n            } elseif ($this->data) {\n                $attachment = $this->decodeContentTransfer($this->getPartBodyFromText($part), $encodingType);\n\n                fwrite($temp_fp, $attachment, strlen($attachment));\n            }\n\n            fseek($temp_fp, 0, SEEK_SET);\n        } else {\n            throw new \\Exception(\n                'Could not create temporary files for attachments. Your tmp directory may be unwritable by PHP.'\n            );\n        }\n\n        return $temp_fp;\n    }\n\n    /**\n     * Decode the string from Content-Transfer-Encoding.\n     *\n     * @return string\n     */\n    private function decodeContentTransfer($encodedString, $encodingType)\n    {\n        $encodingType = strtolower($encodingType);\n\n        if ($encodingType == 'base64') {\n            return base64_decode($encodedString);","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/krayin/laravel-crm/blob/13d6988cda8d69ece45ee1890effc90a7f21cdc1/packages/Webkul/Email/src/Helpers/Parser.php#L714-L750","documentation":"Error \"Could not create temporary files for attachments. Your tmp directory may be unwritable by PHP.\" thrown in krayin/laravel-crm.","triggerScenarios":"Thrown at packages/Webkul/Email/src/Helpers/Parser.php:732 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":"13d6988cda8d69ece45ee1890effc90a7f21cdc1","analyzedAt":"2026-08-17T00:58:29.000Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}