sharp
sharp copied to clipboard
Upload files to not a local disk
I ran into a problem when trying to save files to s3. Through research I found that here https://github.com/code16/sharp/blob/main/src/Form/Fields/Formatters/UploadFormatter.php#L71. You have hardcoded the value "local" instead of use value from $ field->storageDisk()
One more point https://github.com/code16/sharp/blob/main/src/Form/Fields/Formatters/UploadFormatter.php#L76
Yes, at the moment I think Sharp will force you to use the local filesystem for the upload folder, which is the tmp dir. You can of course define a custom filesystem for final storage, but the tmp dire must be local.
But why? It's so sad that we need override this in our code...
No good reason I think :) I'll think about it when I have some time, but feel free to create a PR in the meantime.
This feature will be addresses in the upcoming version 8 of Sharp.
This is fixed in version 8