Problem storing file in folder DO/S3

Posted 1 year ago by eriktobben


I am using the following code to store a public file in Digital Ocean Spaces:

Storage::disk('spaces')->put("img/category/{$fileName}.{$fileContents->extension()}", $fileContents, 'public');

But this is how it is being stored in DO: BUCKET/img/category/8a18ad92-5646-4676-83a1-989a8ec222da-test.jpeg/3RmP6iFEbNx5uF2Jr27ONqL5Apl8gVLKUXLzpVbh.jpeg

So my file name becomes a folder. How can I specify what folder to store the file in and set a custom file name?

Please sign in or create an account to participate in this conversation.