Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jorisvanandel's avatar

(SOLVED) Can't delete files on Digital Ocean Space from Laravel Application

Hi,

I can upload files to my digital ocean running the following code:

Storage::disk('do_spaces')->putFileAs(
                $folder->slug . '/original', $file, $filename, 'public'
            );

However, when I try to delete it with the following code, it doesn't do anything.

Storage::disk('do_spaces')->delete($file->folder->slug . '/original/' . $file->name);

Anyone has any idea why this codeline doesn't delete the file? Thanks in advance.

0 likes
3 replies
D9705996's avatar

@jorisvanandel - Could you please share your solution to help others if they have the same issue (and please mark your answer as best answer so it shows up in the solved category)

chinb's avatar

@jorisvanandel May I know what solution you had come up with? I am having the same problem, I tested it in local filesystem and works as expected, but delete no longer works when switching to do spaces.

Please or to participate in this conversation.