S3 Url
Hi there!
I was trying to use all images to be hosted using AWS S3, found the link is broken. Apparently it changes the "/" into %5C
https://xxxx.s3.ap-southeast-1.amazonaws.com/public%5CLogo-2021-Simplified.png
If I were to manually change the %5C to "/" it works fine. Any idea what went wrong?
Hi there,
Does this happen with Wave or with Tails?
If this is with Wave, would you mind sharing your config here? Make sure to remove any sensitive information first.
'public' => [
'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'),
'endpoint' => env('PROFILE_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'visibility' => 'public',
'root' => 'public'
],
This is from config/filesystems.php
'storage' => [
'disk' => 'public',
],
This is from config/voyager.php
AWS_ACCESS_KEY_ID=XXXXX
AWS_SECRET_ACCESS_KEY="XXXX"
AWS_DEFAULT_REGION="ap-southeast-1"
AWS_BUCKET="XXXXXX"
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_URL=""
This is my .env AWS configuration
Hi there,
The configuration looks correct. The %5C
is actually a backslash not a forward slash. What you could try is using encoded forward slash %2F
which should work fine.
How are you doing the path construction exactly? You need to make sure that the code which constructs the path to the image on S3 is using forward slashes (/
) instead of backslashes (\
). This is especially important if the development is happening on a Windows machine, which uses backslashes in file paths, unlike UNIX-based systems.