Open felix2056 opened 4 years ago
Hello,
In the demo I just do a listContents
and then search for the uploaded file name.
Unfortunately, Laravel's put
method doesn't return the file ID and this will also not work well if you have duplicate file names.
I believe you can use the underlying nao-pon/flysystem-google-drive package more directly and get some more optimal return values. I'm not very familiar with the underlying API tho, so you'll have to check with the package directly.
Thanks. I just throw an exception if the file being uploaded has the same name and extension with another one already on drive so that way I solved my duplicate file name problem and can now safely fetch files via name. It's not the cleanest approach but it works for me
This method seems to return the file meta data.
This:
dd(Storage::cloud()->getAdapter()->write('test.txt', 'Hello World', new \League\Flysystem\Config([])));
Gave me:
[
"name" => "test.txt"
"type" => "file"
"path" => "XXXXXXXXXXXXXXXXXXXXX"
"filename" => "test"
"extension" => "txt"
"timestamp" => 1579962626
"mimetype" => "text/plain"
"size" => 11
]
@ivanvermeyen thank you, my friend!
How do I do this please?