if (thumb) {
if (thumb.size > UserControlsSchema.thumbMinSize
&& thumb.size < UserControlsSchema.thumbMaxSize
&& UserControlsSchema.thumbFileTypes.includes(thumb.type)
) {
await ctx.env.STORAGE.put('someid', thumb.stream())
let thumbURL = `https://images.mydomain.com/${fileId}`
} else {
throw new ServerError("InvalidRequestData", "User thumb doesn't meets the schema requirements");
}
}
if (thumb) {
if (thumb.size > UserControlsSchema.thumbMinSize
&& thumb.size < UserControlsSchema.thumbMaxSize
&& UserControlsSchema.thumbFileTypes.includes(thumb.type)
) {
await ctx.env.STORAGE.put('someid', thumb.stream())
let thumbURL = `https://images.mydomain.com/${fileId}`
} else {
throw new ServerError("InvalidRequestData", "User thumb doesn't meets the schema requirements");
}
}