我正在遵循本指南。我可以将图像上传到我的谷歌硬盘,但我无法获取文件的路径。
https://gist.github.com/ivanvermeyen/cc7c59c185daad9d4e7cb8c661d7b89b
// Get img that was uploaded to my server
$img = request()->file('img');
// Save that image to my google drive
Storage::disk('google')->put('img.png', fopen($img, 'r+'));
// ?? how do I get the path to the file so I can save it in my database?
答案 0 :(得分:0)
您是否在laravel文档中查找过它?
https://laravel.com/docs/5.5/filesystem#file-urls
对于您的代码,您应该使用:
use Illuminate\Support\Facades\Storage;
$url = Storage::disk('google')->url('img.png');
dd($url);