HTTP status code 507 Insufficient Storage indicates that the server is unable to store the representation needed to complete the request. This error is part of the WebDAV extension to HTTP and usually occurs when the server runs out of disk space or allocated storage quota.
The server understands the request and is authorized to process it, but it fails because it cannot store the required data. This is different from 413 Payload Too Large, which refers to request size, not server storage capacity.
// Express.js example sending HTTP 507 status
app.post("/upload", (req, res) => {
res.status(507).json({ error: "Insufficient Storage on Server" });
});
When storage is exhausted, the server responds with:
The client should not retry immediately unless storage conditions are resolved.
// Simulate server storage check in JavaScript
function uploadFile(availableSpace) {
if (availableSpace <= 0) {
return "507 Insufficient Storage";
}
return "200 OK";
}
console.log(uploadFile(0));
Try to upload a 100MB file. Adjust the simulated server capacity below to see how the API responds.