{"record":{"id":"d42b5bcdfa4b4d6d","repo":"bitwarden/server","slug":"invalid-content-d42b5b","errorCode":null,"errorMessage":"Invalid content.","messagePattern":"Invalid content\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/Vault/Controllers/CiphersController.cs","lineNumber":1390,"sourceCode":"\n        await _cipherService.ValidateCipherEditForAttachmentAsync(cipher, userId, orgAdmin, attachment.Size);\n\n        return new AttachmentUploadDataResponseModel\n        {\n            Url = await _attachmentStorageService.GetAttachmentUploadUrlAsync(cipher, attachment),\n            FileUploadType = _attachmentStorageService.FileUploadType,\n        };\n    }\n\n    [HttpPost(\"{id}/attachment/{attachmentId}\")]\n    [SelfHosted(SelfHostedOnly = true)]\n    [RequestSizeLimit(Constants.FileSize501mb)]\n    [DisableFormValueModelBinding]\n    public async Task PostFileForExistingAttachment(Guid id, string attachmentId)\n    {\n        if (!Request?.ContentType.Contains(\"multipart/\") ?? true)\n        {\n            throw new BadRequestException(\"Invalid content.\");\n        }\n\n        var userId = _userService.GetProperUserId(User).Value;\n        var cipher = await GetByIdAsync(id, userId);\n\n        var orgAdmin = false;\n        if (cipher.OrganizationId.HasValue &&\n            await CanEditCipherAsAdminAsync(cipher.OrganizationId.Value, new[] { cipher.Id }))\n        {\n            orgAdmin = true;\n        }\n        var attachments = cipher?.GetAttachments();\n        if (attachments == null || !attachments.TryGetValue(attachmentId, out var attachmentData))\n        {\n            throw new NotFoundException();\n        }\n\n        await Request.GetFileAsync(async (stream) =>","sourceCodeStart":1372,"sourceCodeEnd":1408,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/Vault/Controllers/CiphersController.cs#L1372-L1408","documentation":"Error \"Invalid content.\" thrown in bitwarden/server.","triggerScenarios":"Thrown in CiphersController when the request content is invalid, e.g., malformed multipart data or a body that cannot be parsed for the requested cipher operation.","commonSituations":"See trigger scenarios.","solutions":["Verify the multipart form data includes all required fields and valid file content, then retry.","Use the official Bitwarden client or API models to construct the attachment upload.","Check that the content type and encoding of the attachment match the declared metadata."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e93b962371d80964556f5590c6615f5160a437a1","analyzedAt":"2026-08-13T14:22:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}