Please, How do I use the data stored in R2?

I stored the video resource on R2 cloud storage, and then accessed the resource on my web server, but there was an error. May I ask what is the reason? How do you properly access the data in R2
thanyou.

error:Failed to load resource: the server responded with a status of 400 (Bad Request)

html:
video controls
demo source src="xxx://fx.flime.link/cloudv-material/20230520/3997367a01881000c94e2ba800000000.m3u8 " type=“application/x-mpegURL”
/video

  • The full link is here:
    source src="xxx://9a36710ac8cca235228dcc7607e21c05.r2.cloudflarestorage.com/buckettemp1/test2-lucene-m3u8/lucene.m3u8 " type=“application/x-mpegURL”

R2 buckets (and the objects within them) are not publicly accessible by default. You need to explicitly configure public access by connecting the domain(s) they can be accessed from.

Public buckets can be set up in either one of two ways:

  1. By connecting a custom domain under your control – this is recommended for production, as it allows you to configure firewall rules, caching, access controls, and bot management for the bucket
  2. By enabling the Cloudflare-managed subdomain under r2.dev.

Please see the full documentation below:

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.