curl post file 文件图片上传

curl -F "[email protected];filename=1.jpg;type=image/jpeg"
-F "handphone=15372052089"
-F "type=2"
-F "sharing=false"
http://172.16.16.158:8080/greentown/api2/savePic.htm

//curl命令说明
-F 表示向服务器提交表单
[email protected]
相当于 <input type="file" name="picFile" value="1.jpg">

filename=1.jpg;type=image/jpeg
分别代表上传到服务器的文件名和类型

handphone=15372052089
相当于 <input type="text" name="handphone" value="15372052089"

其它以些类推

最后一个是提交的地址

你可能感兴趣的:(curl post file 文件图片上传)