dimanche 21 avril 2019

Storage disk url with s3 giving me the wrong s3 url

Storage disk url with s3 giving me the wrong s3 url

I am using Laravel's Filesystem to store items on s3 and I am getting the wrong URL.

request->file('company_logo')->store('library');

working good

and when extracet url s3 giving me the wrong s3 url

Storage::disk()->url($path_company_logo);

reselt

This URL

http://alumni-club-files.s3-us-east-1.amazonaws.com/library/DyawVxh2XI82qV9b91d2sZHuwRVeUEIu8Vp8PRu2.png

should be

http://alumni-club-files.s3.amazonaws.com/library/DyawVxh2XI82qV9b91d2sZHuwRVeUEIu8Vp8PRu2.png

config/filesystem.php


        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
        ],

.env


S3_KEY=MYKEY
S3_SECRET=mySecr3tmySecr3tmySecr3tmySecr3t
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=alumni-club-files
AWS_URL=http://alumni-club-files.s3-us-east-1.amazonaws.com

I tryed


S3_KEY=MYKEY
S3_SECRET=mySecr3tmySecr3tmySecr3tmySecr3t
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=alumni-club-files
AWS_URL=http://alumni-club-files.s3.amazonaws.com

and


S3_KEY=MYKEY
S3_SECRET=mySecr3tmySecr3tmySecr3tmySecr3t
AWS_DEFAULT_REGION=
AWS_BUCKET=alumni-club-files
AWS_URL=http://alumni-club-files.s3.amazonaws.com

the same problem



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire