sharp icon indicating copy to clipboard operation
sharp copied to clipboard

Upload files to not a local disk

Open Petrov-Dmitry opened this issue 2 years ago • 4 comments

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()

Petrov-Dmitry avatar Jun 30 '22 08:06 Petrov-Dmitry

One more point https://github.com/code16/sharp/blob/main/src/Form/Fields/Formatters/UploadFormatter.php#L76

Petrov-Dmitry avatar Jun 30 '22 13:06 Petrov-Dmitry

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.

dvlpp avatar Jun 30 '22 13:06 dvlpp

But why? It's so sad that we need override this in our code...

Petrov-Dmitry avatar Jun 30 '22 14:06 Petrov-Dmitry

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.

dvlpp avatar Jun 30 '22 14:06 dvlpp

This feature will be addresses in the upcoming version 8 of Sharp.

dvlpp avatar Jun 08 '23 12:06 dvlpp

This is fixed in version 8

dvlpp avatar Aug 22 '23 12:08 dvlpp