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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.