Ayakase
Ayakase

Reputation: 9

Assets uploaded to S3 bucket can't be loaded in third-party app?

I'm using S3 to store images uploaded, and trying to integrate with LINE messaging API, in short, I have to send this object to the LINE API endpoint:

{
  "type": "imagemap",
  "baseUrl": "{image_url}",
  "altText": "This is an imagemap",
  "baseSize": {
    "width": 1040,
    "height": 1040
  }
} 

in which the URL will be the image that I uploaded to S3 and it will be sent to LINE users as a message, the problem is that although the API returned 200 with no error message, it always shows unable to load photo in the LINE app, I tried to upload the exact same photo with the same dimension (1040x1040) and size to Imgur and Google Firebase Storage and it worked like a charm, I can still view the S3 image in incognito mode so I think I might have missed something about the permission of S3 entities configuration, I tried to grant all the read access but it still doesn't work.

This is my CORS configuration, I also checked the metadata and it is image/jpeg, still don't know what went wrong 😂

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]

Which could possibly go wrong ?

I tried to grant all the read access and CORS, people can see the pic via URL, yet it still doesn't show up in the LINE app

Upvotes: 0

Views: 13

Answers (0)

Related Questions