nao-pon/flysystem-google-drive

Delete files using Storage

helderferrari2 opened this issue · 4 comments

Hello guys,

I wanna delete some files by filename or fullpath, is possible using STORAGE?

$arrFilenames = ['file1.png', 'file2.png'];
Storage::disk('google')->delete($arrFilenames);

Do you have found a solution for this issue?

@DeeSouza No, I don't, to be honest, I just remove the filepath from my database.

You can't delete file using your original file name / path. You need to delete those file using Google Drive specific file name / path. You can get Google Drive specific path when you execute ->write() or ->writeStream() function, it would return an array, the path key is your file path in Google Drive, it's something like

1AcrcenV7XzIQQDogsURDF2n2WsBBBoPj/1anD6QH3peVXbCvuJ693viCOc7xLjOaJ9.

@DeeSouza did you try flysystem-google-drive-ext , it can delete files only with the path