gpt4 book ai didi

html - 使用
上传文件不会发送文件

转载 作者:太空宇宙 更新时间:2023-11-04 15:26:43 25 4
gpt4 key购买 nike

我正在尝试根据 this answer 上传文件:

<form enctype="multipart/form-data" action="http://localhost:61113/api/file/upload" method="post">
<div>
<input type="text" placeholder="No file selected" id="txtPath" />
<div id="div-btn">
Choose File
<input type="file" class="hide_file" id="browse-btn">
</div>
</div>
<button id="btnScan" type="submit">Scan</button>
</form>

但在服务器端我只得到请求的内容:

------WebKitFormBoundaryYhhj0sW5ARh7d9ZO--

我看不到文件的内容,我的意思是它似乎没有发送文件,我错过了什么?

最佳答案

您缺少名称属性

<input type="file" class="hide_file" id="browse-btn" name="file">

关于html - 使用 <form> 上传文件不会发送文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58639505/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com