ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข13mo agoโ€ข
5 replies
ayushh

Generate R2 Objecs Public URL

I would like to retrieve the public url once the upload is completed, but I am getting a url with some headers X-Amz-Date and like those, I want to list my pdfs to my public website.
   // Generate a public URL for the uploaded file
        const publicUrl = r2.getSignedUrl('getObject', {
            Bucket: process.env.R2_BUCKET,
            Key: fileName,
        });
   // Generate a public URL for the uploaded file
        const publicUrl = r2.getSignedUrl('getObject', {
            Bucket: process.env.R2_BUCKET,
            Key: fileName,
        });

Correct me if that's okay to use such url and expose to public.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Public R2.dev url, SSL error
Cloudflare DevelopersCDCloudflare Developers / general-help
2y ago
Public access on r2
Cloudflare DevelopersCDCloudflare Developers / general-help
11mo ago
R2 Public Access bricked website!!!
Cloudflare DevelopersCDCloudflare Developers / general-help
15mo ago
Cloudflare R2 public bucket urls with %27 not found
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago