Failed uploads with zero bytes
Millions of images are uploaded to Sirv each week. Some of these files may contain zero bytes, meaning that they are broken. This article explains what these files are and how to fix them.
What is a zero byte file?
An image file with zero bytes is corrupt and cannot be viewed or recovered. If you try to view a zero byte file, you will see a 415 error:
https://demo.sirv.com/Examples/zero-byte-example.jpg
To have zero bytes, it means the "body" of the file contains no data. The "body" of an image file should contain the data of all the pixels that comprise the image. Every image file also contains a "header", which would normally contain metadata about the image (such as its dimensions, color profile and format). For a 0 byte file, neither the body or header exist.
Causes of zero byte files
Zero byte files can be caused in a few ways:
- Already corrupt - the file could have already been corrupt (missing its body) before it was uploaded to Sirv.
- Corrupt during upload - the file could become corrupt on Sirv if the connection is closed before it has finished uploading.
- Corrupt after upload - the file could become corrupt after it has fully uploaded to Sirv, though this is extremely unlikely.
How to solve zero byte files
First, check if the original file is already corrupt. If the file cannot be opened in a browser or an image viewing program, then it is already corrupt. You should obtain a new copy of the image and upload it to Sirv.
If you can open and see the original image, then it is not corrupt. Try uploading the image again to Sirv and try to view it after it has uploaded.
Don't use FTP
Corruption is most likely to happen if you upload by FTP.
FTP is an old protocol from 1998, when it was updated to support IPv6 and extended passive mode. It has multiple possible points of failure. Some FTP programs are more reliable than others - if you use FTP then we recommend using Filezilla, which is the most widely used and reliable FTP program.
The most reliable solution would be to replace FTP in your workflow. A very good FTP alternative is to upload via S3. See the S3 instructions for uploading files with Cyberduck or consider writing your own script to upload via S3. Alternatively, upload files with the Sirv REST API. Or upload to your account at my.sirv.com.
Find zero byte files
If Sirv detects that a zero byte file has been uploaded to your account, it will generate a message on the Notifications page of your Sirv account:

You can also look for any zero byte images by viewing all images in your Sirv account and showing the results in ascending size order.
Uploads fetched from a remote URL
If you upload files with Sirv's URL fetching API method, then zero byte files won't be uploaded. Even if the remote server returns a 200 response, if the body is empty, then the Sirv API will return a failure response. Example:
{ "name": "ApiHttpError", "message": "Failed to fetch file: Request not successful: empty response", "attempted": true, "retryAfter": "2025-02-10T03:40:58.937Z", "attempts": [ { "url": "https://abc-widgets.com/media/catalog/product/2/H/2HoseKit_Black_Carbon_164_1.jpg", "statusCode": 200, "headers": { "result": { "version": "HTTP/2", "code": 200, "reason": "" }, "date": "Mon, 10 Feb 2025 03:39:58 GMT", "content-type": "image/jpeg", "content-length": "0", "last-modified": "Fri, 09 Nov 2018 23:38:22 GMT", "etag": ""0-57a43d8d1e77b"", "cache-control": "public, max-age=31536000", "expires": "Tue, 10 Feb 2026 03:39:58 GMT", "x-frame-options": "SAMEORIGIN", "x-cache-nxaccel": "MISS", "cf-cache-status": "MISS", "accept-ranges": "bytes", "report-to": "{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=%2BVjDKR9%2FasMUp7afb7C0NbOnfpqPqcbsyoEKn0xvaTN7cjQSCuBIn9mgOp4yLOW0ebW0I3t15M8xXhHDFkG4XoUpBEWn6429mzzageUaH2xD%2FG2xYS0pvdcm3nDQUT5uDcIIu04g8aqmfuic"}],"group":"cf-nel","max_age":604800}", "nel": "{"success_fraction":0,"report_to":"cf-nel","max_age":604800}", "server": "cloudflare", "cf-ray": "90f9133cfa36d66d-FRA", "alt-svc": "h3=":443"; ma=86400", "server-timing": "cfL4;desc="?proto=TCP&rtt=5574&min_rtt=5492&rtt_var=1223&sent=7&recv=11&lost=0&retrans=0&sent_bytes=3392&recv_bytes=925&delivery_rate=734204&cwnd=253&unsent_bytes=0&cid=8718ddc85a6d66f8&ts=59&x=0"" }, "date": "2025-02-10T03:39:58.937Z", "error": { "name": "Error", "message": "Request not successful: empty response" }, "timing": { "ns": 0.048722, "connect": 0.054475, "start": 0.119094, "total": 0.119167 } } ] }
Get help
Please contact the Sirv team if you would like help with a zero byte file in your Sirv account.