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

Delete files using Storage

Open helderferrari2 opened this issue 4 years ago • 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);

helderferrari2 avatar Jul 21 '20 13:07 helderferrari2

Do you have found a solution for this issue?

DeeSouza avatar Aug 05 '20 13:08 DeeSouza

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

helderferrari2 avatar Sep 23 '20 02:09 helderferrari2

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.

nmfzone avatar Feb 11 '21 23:02 nmfzone

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

PaolaRuby avatar May 16 '21 12:05 PaolaRuby