Report this

What is the reason for this report?

DO Space CORS Issue For Custom File Formats

Posted on May 30, 2025

Hi, lately have been getting CORS issue while trying to access certain files (.zip) from my space bucket. mp4 & jpg files work well on both localhost & production. I even added http://localhost & my https domain endpoint in CORS configuration to ensure it works but still no solution. File sizes are around 4-10MB



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there!

Have you explicitly set the headers for your .zip files in Spaces? Specifically, the Content-Type and Access-Control-Allow-Origin headers?

I think that even if your CORS config includes the right origins, the actual file response still needs to include the proper headers.

If I remember correctly, for common file types like .mp4 and .jpg, the browser handles them smoothly, but .zip files often trigger a preflight request, and if the response is missing headers like Content-Type: application/zip or doesn’t allow OPTIONS, it;ll fail.

You should double-check that your CORS config includes GET, HEAD, and OPTIONS, and allows the Content-Type header. Also, try setting the MIME type for your .zip files.

If you can, check the browser’s network tab for any failed preflight requests, it can point you straight to what’s missing.

Let me know what you find!

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.