Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileUpload disk attribute is ignored #14503

Open
mrvnklm opened this issue Oct 11, 2024 · 9 comments
Open

FileUpload disk attribute is ignored #14503

mrvnklm opened this issue Oct 11, 2024 · 9 comments
Labels

Comments

@mrvnklm
Copy link

mrvnklm commented Oct 11, 2024

Package

filament/filament

Package Version

latest

Laravel Version

11.23.5

Livewire Version

No response

PHP Version

8.3.11

Problem description

FileUpload::make('original')->disk('local') is ignored. it uses laravels filesystems.php default and also ignores the default_filesystem_disk in filament.php config

Expected behavior

to change disk by using ->disk()

Steps to reproduce

set ->disk() to anything different than your configured laravel default
just create "new user" in test repo and see both uploads succeed even though no s3 credentials are set

Reproduction repository (issue will be closed if this is not valid)

https://github.com/mrvnklm/filament-upload-bug

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@mrvnklm mrvnklm added bug Something isn't working medium priority unconfirmed labels Oct 11, 2024
@balintxd
Copy link

balintxd commented Oct 12, 2024

@mrvnklm Hi there, I can't seem to be able to reproduce the issue, but just to clear things up, if you try creating a user in the repository you provided, both the files get uploaded to the public folder?

@mrvnklm
Copy link
Author

mrvnklm commented Oct 12, 2024

@balintxd yes thats right, i did not figure out why this happens

@binsarjr
Copy link

any solution here?

@mrvnklm
Copy link
Author

mrvnklm commented Oct 21, 2024

any solution here?

are you having the same issue? seems weird, that no one has reported this so far as this is a pretty severe bug.

@binsarjr
Copy link

any solution here?

are you having the same issue? seems weird, that no one has reported this so far as this is a pretty severe bug.

I success to upload it to my S3 minio. But there is no preview when editing. idk

@mrvnklm
Copy link
Author

mrvnklm commented Oct 21, 2024

any solution here?

are you having the same issue? seems weird, that no one has reported this so far as this is a pretty severe bug.

I success to upload it to my S3 minio. But there is no preview when editing. idk

that might have to do with the visibility and url generation of the s3 file, set ->visibility('private') and check your url parameter in s3 filesystem storage

@mrvnklm
Copy link
Author

mrvnklm commented Oct 21, 2024

->maxSize(123456789) seems to be ignored as well as I always receive The mountedActionsData.0.app.f5a6ec10-0e1b-40bd-8d43-514bc6e33893 field must not be greater than 12288 kilobytes.

@binsarjr
Copy link

that might have to do with the visibility and url generation of the s3 file, set ->visibility('private') and check your url parameter in s3 filesystem storage

Forms\Components\FileUpload::make('image')
                    ->disk('s3')
                    ->directory('banners')
                    ->previewable()
                    ->visibility('private')
                    ->required(),

like this? still not work

@binsarjr
Copy link

binsarjr commented Oct 21, 2024

the solution in my case, just make it so that it doesn't just take the file information

Forms\Components\FileUpload::make('image')
                    ->disk('s3')
                    ->directory('banners')
                    ->fetchFileInformation(false)  // <--- this
                    ->previewable()
                    ->required(),

but still, this needs a better solution in the future

My case: uploaded successfully but the preview doesn't appear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

3 participants