我正在尝试通过POST请求上传照片并附上请求(https://github.com/request/request)或 restler(https://github.com/danwrong/restler)
如果我想像这样将表格上传到upload.php,如何设置输入名称属性(值)(name =" file")?
<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" > <!-- <<<this -->
<input id="submit" name="submit" type="submit" value="upfile">
</form>
答案 0 :(得分:0)
答案 1 :(得分:0)
这可以帮助您
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
您还可以看到此链接....