I am trying to build a file management system in Laravel based on league/flysystem: https://github.com/thephpleague/flysystem
我正在使用S3适配器,我可以使用以下方式保存上传的文件:
$filesystem->write('filename.txt', 'contents');
Now I am stuck on generating the download file URL when using the S3 adapter.
文件被正确地保存在S3存储桶中,我有权限访问它们,我只是不知道如何通过league/flysystem包访问S3 getObjectUrl方法.
I have tried:
$contents = $filesystem->read('filename.txt');
but that returns the content of the file.
$contents = $filemanager->listContents();
or
$paths = $filemanager->listPaths();
but they give me the relative paths to my files.
我需要的是像"ht.//[s3-region].amazonaws.com/[bucket]/[dir]/[file]."这样的东西