执行curl上传文件
curl --location --request POST 'http://192.168.65.220:19999/upfile/' \
--form '=@"/C:/Users/Administrator/Downloads/hemleen-lua-resty-shell-master.zip"'
报错option --form: is badly used here
Warning: Illegally formatted input field!
curl: option --form: is badly used here
curl: try 'curl --help' or 'curl --manual' for more information
原因 curl 版本太低不支持 --form参数
把 –form 参数改为 -F 就可以 了
修改后执行
curl --location --request POST http://192.168.65.220:19999/upfile/ -F file=@dist.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
68 8602k 0 0 68 5904k 0 11.6M --:--:-- --:--:-- --:--:-- 11.6M
100 8602k 0 13 100 8602k 16 10.9M --:--:-- --:--:-- --:--:-- 10.9M
save file ok
本文介绍了如何修复CURL在上传文件时遇到的‘--form:isbadlyused’错误,指出是由于curl版本过低导致。通过将--form参数替换为-F并成功执行了POST请求,最后展示了修改后的命令和上传结果。

1万+

被折叠的 条评论
为什么被折叠?



