cloudinary-laravel icon indicating copy to clipboard operation
cloudinary-laravel copied to clipboard

Upload File from Disk -> MediaAlly

Open GLStephen opened this issue 1 year ago • 0 comments

This fails because it's not an "SplFile" which supports "getRealPath", but the path there IS the real path.

$user->attachMedia(Storage::path($path), $file_name);

I'm trying to support Laraval Livewrire uploads which uploads to a temporary directory locally and then attach to a model and upload to Cloudinary.

This check: https://github.com/cloudinary-devs/cloudinary-laravel/blob/63400a9eab277bb2e0623feb5e1dc3c0bf0965a4/src/MediaAlly.php#L33

Seems incompatible with this: getRealPath call.

https://github.com/cloudinary-devs/cloudinary-laravel/blob/63400a9eab277bb2e0623feb5e1dc3c0bf0965a4/src/MediaAlly.php#L37

file_exists expects a string, while getRealPath expects an object.

GLStephen avatar Nov 21 '23 19:11 GLStephen