如何使用Multer上传嵌套文件?

发布于 2025-01-24 20:59:04 字数 392 浏览 0 评论 0原文

我想知道,当所需的请求主体如下嵌套时,使用Multipart/form-data上传多个图像的方式。目前,我尝试使用 multer 使用单键值对上传图像,而且工作正常。但是,我是否可以将文件上传到file_path属性并将其发送到后端。

{
    "Name": "",
    "Description": "",
    "Images": [{
            "field_name": "Field 1",
            "input": [{
                "type": "image",
                "file_path": "Uploading File"
            }]
        }
}

I want to know the way of uploading multiple images using multipart/form-data when the required request body is nested as below. Currently I tried uploading images using multer with single key value pair and it's working fine. But, is there any alternative through which I can upload file to file_path property and send it to the backend.

{
    "Name": "",
    "Description": "",
    "Images": [{
            "field_name": "Field 1",
            "input": [{
                "type": "image",
                "file_path": "Uploading File"
            }]
        }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文