nao-pon/flysystem-google-drive

how to get file link after upalod?

hamedbaftam opened this issue · 1 comments

hi i want to get link of file when uploaded

you can get fileid using following trick,
It searches around 12000 files in 1.5 seconds.

function getId(Array $array, $key, $value)
{   
  foreach ($array as $subarray)
    {  
      if (isset($subarray[$key]) && $subarray[$key] == $value)
      return $subarray;       
    } 
}

$listContents = Storage::disk('google')->listContents();
$id = getId($listContents, 'name', $filename);
echo $id['path'];