how to get file link after upalod?
hamedbaftam opened this issue · 1 comments
hamedbaftam commented
hi i want to get link of file when uploaded
Deleted user commented
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'];