const uploadFile = new File([blob], `${imageCustomId}.png`, {
type: 'image/png'
}) as FileEsque;
uploadFile.customId = imageCustomId; // Set the customId to the imageCustomId
// Upload the image using fetch
const uploadResponse = await utapi.uploadFiles(uploadFile);
if (uploadResponse.error) {
throw new Error(
`Upload failed with Error: ${uploadResponse.error.message} and code: ${uploadResponse.error.code}`
);
}
const uploadFile = new File([blob], `${imageCustomId}.png`, {
type: 'image/png'
}) as FileEsque;
uploadFile.customId = imageCustomId; // Set the customId to the imageCustomId
// Upload the image using fetch
const uploadResponse = await utapi.uploadFiles(uploadFile);
if (uploadResponse.error) {
throw new Error(
`Upload failed with Error: ${uploadResponse.error.message} and code: ${uploadResponse.error.code}`
);
}