I want to delete files from my bucket programmatically but it is not happening
I have the below code
$s3 = \Storage::disk('s3');
$existingImagePath = $studentPortfolios[$i]->portfolio_link; // this returns the path of the file stored in the db
$s3->delete($existingImagePath);
But this is not deleting the files from the bucket
I have to write objects permission to the bucket for everyone for the time being as I am running this from my local setup.
Please note:- I am able to upload files but deleting is not working
Any advice on this will be really helpful.
Did you try to deleting the files in the bucket using the aws s3 cli command and see if it works ?
Ex: aws s3 rm s3://bucket-name/ --recursive
If it works then may be you need to fix the issue in your code.