Issue uploading images to Sanity Studio
I'd be happy to help troubleshoot your image upload issue! There are several common causes for image upload problems in Sanity Studio. Let me walk you through the most likely solutions:
1. Check your schema configuration
First, make sure your image field is properly configured in your schema:
{
name: 'mainImage',
title: 'Main Image',
type: 'image',
options: {
hotspot: true // optional, enables cropping/focal point
}
}2. Verify CORS origins
This is the most common culprit! Your Studio's domain needs to be added to your project's CORS origins:
- Go to manage.sanity.io
- Select your project
- Navigate to Settings → API settings
- Add your Studio URL to CORS origins (e.g.,
http://localhost:3333for local development or your production Studio URL)
3. Check authentication
Make sure you're logged in to the Studio. If your session has expired, uploads will fail. Try logging out and back in.
4. File size and format
- Check if your image file is too large (default max is 5MB for free plans)
- Ensure the file format is supported (JPG, PNG, GIF, SVG, WebP are standard)
5. Browser console errors
Open your browser's developer console (F12) and look for any error messages when you attempt to upload. Common errors include:
- 401/403 errors → authentication/CORS issue
- Network errors → connectivity problem
- 413 errors → file too large
6. Network/firewall issues
If you're behind a corporate firewall or VPN, it might be blocking uploads to Sanity's asset CDN. Try disconnecting from VPN or checking with your IT department.
What specific behavior are you seeing? For example:
- Does nothing happen when you click upload?
- Do you see an error message?
- Does the upload start but then fail?
The error details will help narrow down the exact cause. In the meantime, checking CORS settings is usually the quickest fix for most upload issues!
Show original thread50 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.