You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
S3 cloud storage overwrites filesize to zero when editing an image #8108
Payload: 3.0.0-beta.100
Next js: 15.0.0-canary.137
Describe the Bug
When using @payloadcms/storage-s3 as media storage I've noticed that when I edit an existing file, the filesize database column gets overwritten to 0. This then shows in the frontend to as if the image has no bytes.
Reproduction Steps
Configure an upload collection with any text field (e.g.: name)
Configure @payloadcms/storage-s3 as media storage for that collection
Upload an image
Edit the text field (e.g.: name)
filesize will get written again to 0, removing valuable information about the file
has anyone got a resolution to this?
some more detail from my perspective.. this does not happen for local storage. it starts happening when I switch to the s3 adaptor ( @payloadcms/storage-s3 ). I'm using @payloadcms/storage-s3 3.11.0
when I upload an image initially everything is fine.
the api looks like this... note the file size and mimeType
Hi @cortopy and @rob-at-cortex, we recently pushed multiple updates related to the s3 adapter, some changes were related to this behavior (persisting metadata). Would you please retest on the latest version v3.74.0 and let me know if this issue is still occurring for either of you?
Since we haven’t heard back in a while and this issue relates to several releases ago, we’re going to close it for now. If you’re still seeing this behavior on the latest version (v3.77.0), please let me know and we can re-open this.
Activity
github-actions commentedon Dec 13, 2024
This issue has been marked as stale due to lack of activity.
To keep this issue open, please indicate that it is still relevant in a comment below.
cortopy commentedon Dec 13, 2024
Still happening
rob-at-cortex commentedon Jan 8, 2025
has anyone got a resolution to this?
some more detail from my perspective.. this does not happen for local storage. it starts happening when I switch to the s3 adaptor ( @payloadcms/storage-s3 ). I'm using @payloadcms/storage-s3 3.11.0
when I upload an image initially everything is fine.

the api looks like this... note the file size and mimeType
{ "id": 2, "alt": null, "prefix": "custom-images", "updatedAt": "2025-01-08T13:23:15.097Z", "createdAt": "2025-01-08T13:23:15.097Z", "url": "/api/images/file/iStock-1305515723.jpg", "thumbnailURL": "/api/images/file/iStock-1305515723-300x200.jpg", "filename": "iStock-1305515723.jpg", "mimeType": "image/jpeg", "filesize": 137620, "width": 2121, "height": 1414, "focalX": 50, "focalY": 50, "sizes": { "thumbnail": { "url": "/api/images/file/iStock-1305515723-300x200.jpg", "width": 300, "height": 200, "mimeType": "image/jpeg", "filesize": 5353, "filename": "iStock-1305515723-300x200.jpg" }, "square": { "url": "/api/images/file/iStock-1305515723-500x500.jpg", "width": 500, "height": 500, "mimeType": "image/jpeg", "filesize": 22856, "filename": "iStock-1305515723-500x500.jpg" }, "small": { "url": "/api/images/file/iStock-1305515723-600x400.jpg", "width": 600, "height": 400, "mimeType": "image/jpeg", "filesize": 16690, "filename": "iStock-1305515723-600x400.jpg" }, "medium": { "url": "/api/images/file/iStock-1305515723-900x600.jpg", "width": 900, "height": 600, "mimeType": "image/jpeg", "filesize": 32947, "filename": "iStock-1305515723-900x600.jpg" }, "large": { "url": "/api/images/file/iStock-1305515723-1400x933.jpg", "width": 1400, "height": 933, "mimeType": "image/jpeg", "filesize": 69422, "filename": "iStock-1305515723-1400x933.jpg" }, "xlarge": { "url": "/api/images/file/iStock-1305515723-1920x1280.jpg", "width": 1920, "height": 1280, "mimeType": "image/jpeg", "filesize": 116051, "filename": "iStock-1305515723-1920x1280.jpg" } } }if I now edit the Alt text the UI shows the following..
the API shows similar issues in the main metadata.
{ "id": 2, "alt": "alt", "prefix": "custom-images", "updatedAt": "2025-01-08T13:25:44.496Z", "createdAt": "2025-01-08T13:23:15.097Z", "url": "/api/images/file/iStock-1305515723.jpg", "thumbnailURL": "/api/images/file/iStock-1305515723-300x200.jpg", "filename": "iStock-1305515723.jpg", "mimeType": "text/html", "filesize": 2607, "width": 2121, "height": 1414, "focalX": 50, "focalY": 50, "sizes": { "thumbnail": { "url": "/api/images/file/iStock-1305515723-300x200.jpg", "width": 300, "height": 200, "mimeType": "image/jpeg", "filesize": 5353, "filename": "iStock-1305515723-300x200.jpg" }, "square": { "url": "/api/images/file/iStock-1305515723-500x500.jpg", "width": 500, "height": 500, "mimeType": "image/jpeg", "filesize": 22856, "filename": "iStock-1305515723-500x500.jpg" }, "small": { "url": "/api/images/file/iStock-1305515723-600x400.jpg", "width": 600, "height": 400, "mimeType": "image/jpeg", "filesize": 16690, "filename": "iStock-1305515723-600x400.jpg" }, "medium": { "url": "/api/images/file/iStock-1305515723-900x600.jpg", "width": 900, "height": 600, "mimeType": "image/jpeg", "filesize": 32947, "filename": "iStock-1305515723-900x600.jpg" }, "large": { "url": "/api/images/file/iStock-1305515723-1400x933.jpg", "width": 1400, "height": 933, "mimeType": "image/jpeg", "filesize": 69422, "filename": "iStock-1305515723-1400x933.jpg" }, "xlarge": { "url": "/api/images/file/iStock-1305515723-1920x1280.jpg", "width": 1920, "height": 1280, "mimeType": "image/jpeg", "filesize": 116051, "filename": "iStock-1305515723-1920x1280.jpg" } } }JessRynkar commentedon Feb 2, 2026
Hi @cortopy and @rob-at-cortex, we recently pushed multiple updates related to the
s3adapter, some changes were related to this behavior (persisting metadata). Would you please retest on the latest version v3.74.0 and let me know if this issue is still occurring for either of you?JessRynkar commentedon Feb 20, 2026
Since we haven’t heard back in a while and this issue relates to several releases ago, we’re going to close it for now. If you’re still seeing this behavior on the latest version (v3.77.0), please let me know and we can re-open this.
github-actions commentedon Feb 28, 2026
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.