Uploading File Gives [Method Not Allowed] error when uploaded via filepond
I am getting the following error when try to upload files via Filament.
The GET method is not supported when for route Livewire/upload-file.
I am working on it locally at the moment. I am using Laravel 11.x with Laragon. Serving from public folder. I am not using php artisan serve to serve
app.
File upload code:
26 Replies
Can somebody please guide me on resolving this issue? Thanks in advance!
@Leandro Ferreira can you please help me?
it looks ok. Maybe you could try the FileUpload field in another project or Filament fresh install to see if it happens
Thanks, let me try that
I am using v^3.2.52. is that okay? or should i use another much stabler version.
latest version
Thanks, installing new version...
Just installed new version using
composer require filament/filament:"^3.2" -W
Still same errorcomposer.json
You should be getting a 405 error for invalid method, but seems you are getting a 500? Possibly getting a new error?
It's the same error as above shared.
That isn't the error you are getting, in dev tools on the filament page inspect Network > Click on the erroring request > Response.
Or check your storage/logs
let me check
i cleared
storage/logs
tried to re-upload the image. this is what i am getting.
Is this using the local disk?
I see the public lines were commented out
Try specifying
->directory('example')
on the field to see if it resolves it.Thanks, let me try it. btw in .env file, the following config is set.
FILESYSTEM_DISK=local
There is also a
FILAMENT_FILESYSTEM_DISK
which is also used in the filament.php config file if you have published that but I think that fallbacks to FILESYSTEM_DISK
.yup, i haven't set this
FILAMENT_FILESYSTEM_DISK
variable. let me try overriding FILESYSTEM_DISK
setting it to publicWhy would you need to do that?
You can uncomment the disk lines on your field above if you want it in public
oh ok
Did you test with the directory method?
If you are using the
local
disk then it should use this as the default root path unless you have changed it:
https://github.com/laravel/laravel/blob/657070ea8a95ec269d0ed4c801cead04976a871a/config/filesystems.php#L35
The public disk will use this:
https://github.com/laravel/laravel/blob/657070ea8a95ec269d0ed4c801cead04976a871a/config/filesystems.php#L42yup, tested with directory() method. this is what i already did, in the my first message of this thread.
i haven't changed any defaults related to filesystem. local still points to
i haven't changed any defaults related to filesystem. local still points to
app/private
and public to app/public
uncommented, still the same issue.
Seems filament defaults to public anyway mb:
https://github.com/filamentphp/filament/blob/86db630d700d7cd727de6c51864b7ce43c38d15b/packages/support/config/filament.php#L44
Googled the error and found this @cmdrpigeon
https://amywestlake.co.uk/notes/file-upload-path-not-empty/
Since your running laragon.
Go to php.ini in your laragon and check upload_tmp_dir
Jynx 😅
try to set a tmp directory like
upload_tmp_dir = C:\laragon\tmp
Yup, it worked.
upload_tmp_dir
was empty and disabled.
assigning and restarting server did the trick!Nice 👍
Please mark as solved ✅
Perfect, Thank you so much @Dan Mason and @Leandro Ferreira . Saved me hours of debugging!
I am sorry. can't seem to find the correct button to mark it as solved
nvm, foun it!