You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Express结合Google Function Framework文件上传失败问题排查

Express 搭配 Google Function Framework 无法实现文件上传的问题

使用Express结合Google Function Framework时,文件上传功能完全失效。尝试过Multer、Formidable、Busboy及原生文件上传方法,这些方案在直接启动Express监听端口时都能正常工作,但结合Function Framework后全部失效。已尝试添加各类body解析器,问题依然存在。

各工具的具体表现如下:

  • Multer:req.file 返回 undefined
  • Formidable:从未进入 form.parse 的处理逻辑
  • 原生文件上传方法:req.on('end') 事件从未触发
  • Busboy:抛出如下错误:

Error parsing the file upload: Error: Unexpected end of form
at Multipart._final (W:\workspace\playground\node_modules\busboy\lib\types\multipart.js:588:17)
at prefinish (node:internal/streams/writable:914:14)
at finishMaybe (node:internal/streams/writable:928:5)
at Writable.end (node:internal/streams/writable:843:5)
at onend (node:internal/streams/readable:946:10)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Exception from a finished function: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

请求已正确设置 Content-Type 为 multipart/form-data; boundary=<calculated when request is sent>。

内容的提问来源于stack exchange,提问作者Nickname0222022022

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 16:29:59