How I Upload Images to CloudFlare R2 in Next.js Server Components (Presigned PUT)

preview_player
Показать описание

🌎 Follow me here:
Рекомендации по теме
Комментарии
Автор

Love you man! I was facing issue to connect with client from my node app for an whole day, found solution to my issue in few minutes only. Thank you so much 🙇‍♂

abhishekbarkade
Автор

awesome tuts, thanks Tom 🙌! just got into some issues although I can successfully store the image into my bucket, but I cannot get the src itself and keep getting that xml error response

edit: fixed the issue, just need to do the GetObjectCommand to retrieve the images after putting it to the bucket

eip
Автор

Thank you Tom for this useful video! 🔥🔥
Could you please consider extending this with a multi file upload with individual progress?
It would be a game changer for me.

naylord
Автор

Could you share repo with the example ?

andreik
Автор

Tom: There won't be many tutorials on this channel anymore
Also Tom a few days later: Makes Tutorial*

VLATLE_
Автор

Thanks, It would be great to make a tutorial about D1 also.

TheAliAhad
Автор

Your font is small...kindly try to enlarge next time...thank you for all you do.

osanyinbiyusuf
Автор

Hey, really liked this video. I have one question, What if we need to upload multiple files do we need to create multiple signed urls for that?

Its-InderjeetSinghGill
Автор

How to upload files to the aws s3 bucket using lambda functions

regilearn
Автор

Sadly, I just get CORS issues doing this, even with a custom domain.

reqtified
Автор

Hi Tom Thanks for such a helpfull video, I'm Facing one issue while accessing the image in FrontEnd using the Token (ReadOnly access)

Here is how I'm call

export const fetchMedia = async (url) => {
const token = "myToken"; // Replace with your actual access token

try {
const response = await axios.get(url, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});

if (!response.ok) {
console.error(
`Failed to fetch media: ${response.status} ${response.statusText}`
);
console.error("Response details:", await response.text());
throw new Error(`Failed to fetch media: ${response.statusText}`);
}

const blob = await response.blob();
const mediaUrl = URL.createObjectURL(blob);
return mediaUrl;
} catch (error) {
console.error("Error fetching media:", error);
return null;
}
};

PremJethwa-qjmp