开发者社区> 问答> 正文

关于socket上传文件的问题

这是上传的内容
POST HTTP/1.1
Accept: /
Accept-Language: zh-CN
Content-Type: multipart/form-data; boundary=-----jPYp4GO0zB402G5
Content-Length: 29845
Connection: Keep-Alive
Host: alpha-private-staging.oss-cn-hangzhou.aliyuncs.com:80

-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="key"

rb/photos/1892870251904/772fd3438b06d8cf2db779d121629500.png
-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="name"

772fd3438b06d8cf2db779d121629500.png
-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="policy"

eyJleHBpcmF0aW9uIjoiMjAxNi0wOC0wM1QxNjoxNjowM1oiLCJjb25kaXRpb25zIjpbWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsMCwxMDQ4NTc2MDAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInJiXC9waG90b3NcLzE4OTI4NzAyNTE5MDRcLyJdXX0=
-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="callback"

eyJjYWxsYmFja1VybCI6Imh0dHA6XC9cL2FwaS5yb2JvdC5vZHVvbGEuY29tXC9tXC91cGxvYWRcL2NhbGxiYWNrP3BvbGljeT1waG90byUzQTE4OTI4NzAyNTE5MDQmZ3VpZD0xODkyODcwMjUxOTA0IiwiY2FsbGJhY2tIb3N0IjoiYXBpLnJvYm90Lm9kdW9sYS5jb20iLCJjYWxsYmFja0JvZHkiOiJmaWxlbmFtZT0ke29iamVjdH0mc2l6ZT0ke3NpemV9Jm1pbWVUeXBlPSR7bWltZVR5cGV9JmhlaWdodD0ke2ltYWdlSW5mby5oZWlnaHR9JndpZHRoPSR7aW1hZ2VJbmZvLndpZHRofSZmb3JtYXQ9JHtpbWFnZUluZm8uZm9ybWF0fSIsImNhbGxiYWNrQm9keVR5cGUiOiJhcHBsaWNhdGlvblwveC13d3ctZm9ybS11cmxlbmNvZGVkIn0=
-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="OSSAccessKeyId"

jP4WlVysXeCDlzLx
-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="success_action_status"

200
-------jPYp4GO0zB402G5
Content-Disposition: form-data; name="signature"

pNl5EkcBS/Vt+IQoVooLVOkPk4A=
-------jPYp4GO0zB402G5

Content-Disposition: form-data; name="file"; filename="772fd3438b06d8cf2db779d121629500.png"
Content-Type: image/png

(这里是字节内容)
-------jPYp4GO0zB402G5--

这是用socket上传文件出现的问题
Your browser sent a request that this server could not understand

还有就是用第三方http上传时候发现另外一个问题
<?xml version="1.0" encoding="UTF-8"?>

   <Code>InvalidArgument</Code>
   <Message>The bucket POST must contain the specified 'key'. If it is specified, please check the order of the fields</Message>
  <RequestId>57A1AA3895B3283AE1AE8A13</RequestId>
  <HostId>alpha-private-staging.oss-cn-hangzhou.aliyuncs.com</HostId>
 <ArgumentName>key</ArgumentName>
   <ArgumentValue></ArgumentValue>

这个key明明是传了并且有值,而且把主机地址修改上传到自己电脑架设的tomcat服务器是可以接收到全部的值的包括文件

上述的问题怎么解决呢?请教一下!

展开
收起
潜修修道 2016-08-03 16:30:25 2677 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载