Fabian
03/14/2023, 3:09 PMts
const { readable, writable } = new TransformStream();
req.body.pipeTo(writable);
const formData = new FormData();
formData.append(
"file",
readable,
"test.jpg"
);
const response = await fetch(
"...",
{
method: "POST",
body: formData
}
);
Which does not work - at least when uploading the image to Cloudflare Images, it says that the image has an incorrect mime type. If I read the whole body and append it into the form data, it does work as expected - but since that obviously isn't recommended because of the memory limit, I don't like that approach. I couldn't find anything on the interwebzFabian
03/14/2023, 4:17 PMzszszsz
03/14/2023, 4:33 PMzszszsz
03/14/2023, 4:35 PMFabian
03/14/2023, 4:43 PMSkye
03/14/2023, 4:45 PMSkye
03/14/2023, 4:46 PMSkye
03/14/2023, 4:46 PMdave
03/14/2023, 4:57 PMTom Sherman
03/14/2023, 4:59 PMTom Sherman
03/14/2023, 5:04 PMjs
const request = new MultipartRequest(url)
request.append({
headers: {
"content-disposition": `form-data; name="file"; filename="test.jpg"`
},
body: req.body
})
const response = await fetch(request);
Tom Sherman
03/14/2023, 5:05 PMplutoniumm
03/14/2023, 5:47 PMmacOS Safari 14.1
Can we bundle a custom JS on the fly and send only the polyfills/optimisations needed for Safari 14.1 specifically and none else. (assuming tree shaking specific to browser is possible which in itself is a mountainclimb task)plutoniumm
03/14/2023, 5:48 PMDani Foldi
03/14/2023, 5:49 PMplutoniumm
03/14/2023, 5:51 PMDani Foldi
03/14/2023, 6:02 PMzszszsz
03/14/2023, 6:18 PMzszszsz
03/14/2023, 6:19 PMzszszsz
03/14/2023, 6:21 PMzszszsz
03/14/2023, 6:22 PMFabian
03/14/2023, 7:20 PMFabian
03/14/2023, 7:21 PMTom Sherman
03/14/2023, 7:23 PMFabian
03/14/2023, 7:23 PMFabian
03/14/2023, 7:28 PMzszszsz
03/14/2023, 7:29 PMFabian
03/14/2023, 7:31 PMFabian
03/14/2023, 7:32 PMdave
03/14/2023, 7:32 PM