Was hoping to get some insight to see what I might be missing since I'm noticing the video I'm trying to upload isn't working.
I first get a signedURL that connects to my bucket successfully. I then
const submitVideo = async () => {
const url = await getSignedUrl({
variables: { filename: "google.jpeg" }
}).then(async response => {
if (response.data && response.data.getSignedUrl) {
const url = response.data.getSignedUrl.url;
const pathUrl = url.split('?');
const videoPath = pathUrl[0];
const uploadedReponse = await uploadToGoogleCloud(url);
}
});
}
const uploadToGoogleCloud = async (url) => {
const videoFile = await fetch(video.uri);
const blob = await videoFile.blob();
const response = await fetch(url, {
method: 'PUT',
body: blob,
}).then(res => console.log("thres is ", res)).catch(e => console.log(e));
}
When I worked with AWS. Doing this worked without an issue.
const type = video.split('.').pop();
const videoFile = await fetch(video);
const blob = await videoFile.blob();
const response = await fetch(uri, {
method: 'PUT',
body: blob,
headers: {
'Content-Type': type,
'x-amz-acl': 'public-read'
}
}).catch((e) => console.log('THE ERROR FOR VIDEO UPLOAD IS ', e));
Is it because I am missing Content-Type and x-amz-acl? I'm not seeing any error appear which is why I was hoping to get some insight. Thank you in advance.