luke.korea8697
luke.korea8697

Hi,

I searched support for this issue already and didn't find it, so:

I followed the instructions on setting up an S3 bucket (and in my case CloudFront) as my media server. It generally works, in the sense that I can upload images successfully to my bucket, and enter the URL and they all appear fine.

However, when I click the "Public URL" of said image in the backend, it looks like this:

https://s3-ap-northeast-1.amazonaws.com/[MY BUCKET][IMAGENAME].png

Notice the missing slash between the bucket name and image file name. It does the same thing if I use my CDN address. I've tried everything for the "folder" and "path" settings in config/cms.php but can't get a working combination.

Any idea how I should set the folder and path up. I am just using the root folder of the bucket, I did not set up a directory within the bucket. Is this absolutely necessary?

Thanks.

Crazymodder
Crazymodder

Can you pls. post your configs here?

luke.korea8697
luke.korea8697

From filesystems.php:

 'local' => [
            'driver' => 'local',
            'root'   => storage_path().'/app',
        ],
    's3' => [
            'driver' => 's3',
            'key'    => 'XXX',
            'secret' => 'XXX',
            'region' => 'ap-northeast-1',
            'bucket' => 'ejenglishmedia',
        ],

From cms.php:

 'uploads' => [
            'disk'   => 's3',
            'folder' => '',
            'path'   => 'https://s3-ap-northeast-1.amazonaws.com/ejenglishmedia/',
        ],
        'media' => [
            'disk'   => 's3',
            'folder' => '',
            'path'   => 'https://s3-ap-northeast-1.amazonaws.com/ejenglishmedia/',
        ],

I've tried every combination in the folder/path combo of cms, including the trailing slash after path, or including it in "folder" (it's just the root of the bucket). But all links in the Public URL from the backend look like this:

https://s3-ap-northeast-1.amazonaws.com/ejenglishmediabaloons.png

The uploads are working, though, because when I add the slash after 'ejenglishmedia':

https://s3-ap-northeast-1.amazonaws.com/ejenglishmedia/baloons.png

Sure enough, there it is. I want the backend to put the slash in correctly between 'media' and the file name without me manually doing it in the address bar. What am I missing?

Last updated

sercanvirlan
sercanvirlan

i have same problem

ernie
ernie

Hello, I'm running into this issue as well. Anyone know why the extra slash isn't showing up?

ernie
ernie

Playing with this, it seems that the issue is that the code doesn't anticipate the root folder of a bucket. Adding a subfolder fixes the problem.

Still seems like it should handle the root folder.

ernie
ernie

Hi, I have a GitHub issue related to this. If you're running into this on your build, please leave a comment confirming it. (And if you have a solution, please share, of course.) Thanks.

https://github.com/octobercms/october/issues/3445

1-7 of 7