© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
13 replies
player

Spatie Livewire File Uploads 401 on server

Hello everyone! I'm using Filament 3.x and Spatie Media Library + docker compose.
On the local env everything is ok, but on the server I has 401 error while uploading files via upload-file?expires=1713776933&signature=6e883bc3f42d1117c5ceee6994d857a0f4df044c55f608a86619e2c0d97ad817

Googled it, but didn't find working solution. Any tips?
Solution
I added
if($this->app->environment('production')) {
URL::forceScheme('https');
request()->server->set('HTTPS', request()->header('X-Forwarded-Proto', 'https') == 'https' ? 'on' : 'off');
}
to AppProvider, but now I have another issue - uploaded photos don't show - they try to get url from localhost instead of my server domain
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

File uploads throw a 401
FilamentFFilament / ❓┊help
5mo ago
401 on file uploads after switching to HTTP for localhost
FilamentFFilament / ❓┊help
12mo ago
Spatie/comments-livewire
FilamentFFilament / ❓┊help
15mo ago
Livewire Fileupload (error 401)
FilamentFFilament / ❓┊help
7mo ago