Cloudflare workers send file to use

Im using workers and javascript, and I’m trying to send a ~20kb file in the response body with the ‘octet-stream’ in the headers…

can you help me?

You can refer to the tutorials here Build a QR code generator · Cloudflare Workers docs

const generate = async request => {
  const { text } = await request.json()
  const headers = { "Content-Type": "image/png" }
  const qr_png = qr.imageSync(text || "")
  return new Response(qr_png, { headers })

Set your headers and then tag it in the new response.