flysystem-google-drive icon indicating copy to clipboard operation
flysystem-google-drive copied to clipboard

How to get the real filename of the uploaded files in google drive?

Open EleazarFederio opened this issue 4 years ago • 2 comments

I Tried to get the file using Storage::disk('google)->url($myFileName); but I get false value but when I tried Storage::disk('google')->allFiles() I get a array like this [ "1BIKgS3nWmW9rrhn5gjPk5Mow2SMtPuf5", "1x_yNRPI1qEF3Llkf3_mwO0I-3DvW0MUO", "1zzGMGtAF2e8Qdyti8_-Tew8p1N3oEEi6" ] and when I get one item from the array and put it like this Storage::disk('google)->url('1x_yNRPI1qEF3Llkf3_mwO0I-3DvW0MUO'); I am able to retrieve an image from google drive, my question is how can I get the real name of the uploaded file like the array that was been return using Storage::disk('google)->url('1x_yNRPI1qEF3Llkf3_mwO0I-3DvW0MUO');?

EleazarFederio avatar Jun 12 '20 05:06 EleazarFederio

Use Storage::disk('google')->listContents() instead. Check methods in GoogleDriveAdapter class https://github.com/nao-pon/flysystem-google-drive/blob/master/src/GoogleDriveAdapter.php

mh19 avatar Jul 09 '20 10:07 mh19

Did you try flysystem-google-drive-ext, it gets the name and file path of the files

PaolaRuby avatar May 16 '21 12:05 PaolaRuby