You're on the right track by increasing post_max_size and upload_max_filesize in your php.ini, but there are a few other things to check that could cause file uploads to fail, even at sizes well below your set limits:
- Check for client_max_body_size (Nginx only):
If your server is running Nginx, it has its own limit that can block large uploads, regardless of PHP settings. Make sure your nginx.conf or site config includes:
client_max_body_size 20M;
Reload/restart Nginx if you change this.
- Check memory_limit in php.ini:
Sometimes, PHP's memory_limit may prevent large files from being processed. Try increasing it to at least the size of your largest file, e.g.:
memory_limit = 128M
Or higher, if needed.
- Check max_file_uploads in php.ini:
While less likely to affect single uploads, ensure this value is sufficient (default is 20):
max_file_uploads = 20
- Clear Browser/Server Cache:
Sometimes errors or restrictions may be cached. Try clearing your browser cache and restarting your webserver.
- Double-Check Filament Validation (maxSize):
Your code:
FileUpload::make('pdf_file')
->disk('public')
->directory('music_pdfs')
->maxSize(20000)
->visibility('public'),
Filament's maxSize uses kilobytes. 20000 means ~20MB, which is correct. But consider lowering it for testing (e.g., 6000) to see whether validation fires before PHP-level limits.
- Check Storage Permissions:
Make sure your storage/app/public/music_pdfs directory is writable by your web server process.
- Debugging:
Enable PHP error reporting in your .env:
APP_DEBUG=true
Check your logs (typically in storage/logs/laravel.log) for any clues.
Summary Checklist:
-
post_max_size(>= file size) -
upload_max_filesize(>= file size) -
memory_limit(>= file size) -
client_max_body_size(Nginx, if used) -
max_file_uploads - Storage directory permissions
- Server and browser cache cleared
Check each of these areas, and your uploads should work for files up to your set limits. If you’re still having trouble, let us know what server stack you’re using (Apache/Nginx) and share any error messages you see!