© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•9mo ago•
5 replies
Nick Ruddra

File Uploading problem 401 Error.

[Everything works fine In local Environment]
Hello, I have this problem I'm using ngrok-free to host my app locally to test my app in online. Everything work's fine like loading image assets but when I try to Upload image using FileUpload it cause problem.
btw I didn't face this problem If I use normal upload Like using blade and controller. Here Is My setup that usually work with normal app.

File Upload
    FileUpload::make('thumbnail')
         ->image()
         ->imageEditor()
         ->imageCropAspectRatio('16:9')
         ->disk('products')
         ])->columnSpan(1)
    FileUpload::make('thumbnail')
         ->image()
         ->imageEditor()
         ->imageCropAspectRatio('16:9')
         ->disk('products')
         ])->columnSpan(1)


AppServiceProvider
 public function boot(): void
    {
        if (\App::environment(['production', 'local'])) {
            URL::forceScheme('https');
        }
    }
 public function boot(): void
    {
        if (\App::environment(['production', 'local'])) {
            URL::forceScheme('https');
        }
    }


Env
APP_NAME=asm
APP_ENV=local
APP_KEY=base64:szgyQjydWBZVod7BWujDG/ZYa8CIa94UmPKNeekbgko=
APP_DEBUG=true
APP_URL=https://recently-amusing-hedgehog.ngrok-free.app

ESSION_DOMAIN=.ngrok-free.app
SESSION_SECURE_COOKIE=true

SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,::1,ngrok-free.app,https://recently-amusing-hedgehog.ngrok-free.app
APP_NAME=asm
APP_ENV=local
APP_KEY=base64:szgyQjydWBZVod7BWujDG/ZYa8CIa94UmPKNeekbgko=
APP_DEBUG=true
APP_URL=https://recently-amusing-hedgehog.ngrok-free.app

ESSION_DOMAIN=.ngrok-free.app
SESSION_SECURE_COOKIE=true

SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,::1,ngrok-free.app,https://recently-amusing-hedgehog.ngrok-free.app
Screenshot_2025-05-22_205022.png
Solution
I think
->trustProxies()
->trustProxies()
is the right way. I think you can add your ngrok IP to limit this, but I don't think there is a high risk when you keep your ngrok URL to yourself.
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

401 Unauthorized When Uploading File
FilamentFFilament / ❓┊help
3y ago
Error while uploading the file
FilamentFFilament / ❓┊help
3y ago
Cant Upload File With 401 Error.
FilamentFFilament / ❓┊help
2y ago
Issue uploading file
FilamentFFilament / ❓┊help
2y ago