It doesn't seem possible to use addMedia with files from non-local disks, such as s3. Is this intentional, or am I doing something wrong?
Sure you can, take a look at the example here: https://docs.spatie.be/laravel-medialibrary/v7/advanced-usage/working-with-multiple-filesystems/
Having the same issue - though the issue is not uploading to a separate disk, but uploading from. My use case right now is uploading an avatar via Laravel Vapor S3 stream (all handled on the client), and then on the server I want media-library to add the file that already exists in the S3 bucket in the /tmp directory. Something like addMedia('tmp/something', 's3') would be good.
@freekmurze, sorry if I wasn't clear. What @jameslkingsley described is what I'm looking for - uploading files from a non-local disk.
Right... I think support for this should be added to the medialibrary. Currently I don't have time to look into it. If you need this quick, I'd accept a PR with tests and updated docs that adds support for this to the package.
I'm currently working on getting a quick solution built into this package
Any progress on that?
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
Most helpful comment
Having the same issue - though the issue is not uploading to a separate disk, but uploading from. My use case right now is uploading an avatar via Laravel Vapor S3 stream (all handled on the client), and then on the server I want media-library to add the file that already exists in the S3 bucket in the
/tmpdirectory. Something likeaddMedia('tmp/something', 's3')would be good.