files
Replace file
Replace an existing file with new content while preserving the file ID. The operation follows these steps:
- The isUploaded flag is set to false to mark the file as being updated
- The file content is replaced in the storage backend
- File metadata is updated (size, mime-type, isUploaded, etc.)
Each step is atomic, but if a step fails, previous steps will not be automatically rolled back.
put/files/{id}
Path parameters
idstring required
Unique identifier of the file to replace
Response
File successfully replaced
Example response
{
"id": "d5e76ceb-77a2-4153-b7da-1f7c115b2ff2",
"name": "profile-picture.jpg",
"size": 245678,
"bucketId": "users-bucket",
"etag": "\"a1b2c3d4e5f6\"",
"createdAt": "2023-01-15T12:34:56Z",
"updatedAt": "2023-01-16T09:45:32Z",
"isUploaded": true,
"mimeType": "image/jpeg",
"uploadedByUserId": "abc123def456",
"metadata": {
"alt": "Profile picture",
"category": "avatar"
}
}