开发者社区> 问答> 正文

本地上传正常,ECS服务器上传的文件都是0KB,求解决

centos+nginx+php7环境
上传返回接口如下:
array(6) {
  ["fileUpload"]=>
  string(60) "./Uploads/file/20160728/756362c2072744e639016f9ec9d8d5e7.jpg"
  ["Content-Type"]=>
  string(10) "image/jpeg"
  ["method"]=>
  string(3) "PUT"
  ["bucket"]=>
  string(6) "sdzimg"
  ["object"]=>
  string(58) "Uploads/file/20160728/756362c2072744e639016f9ec9d8d5e7.jpg"
  ["Content-Length"]=>
  int(68174)
}
object(OSS\Http\ResponseCore)#16 (3) {
  ["header"]=>
  array(13) {
    ["server"]=>
    string(9) "AliyunOSS"
    ["date"]=>
    string(29) "Thu, 28 Jul 2016 14:04:30 GMT"
    ["content-length"]=>
    string(1) "0"
    ["connection"]=>
    string(10) "keep-alive"
    ["x-oss-request-id"]=>
    string(24) "579A10EECCB80C2A2AA348FD"
    ["etag"]=>
    string(34) ""D41D8CD98F00B204E9800998ECF8427E""
    ["x-oss-hash-crc64ecma"]=>
    string(1) "0"
    ["x-oss-server-time"]=>
    string(2) "48"
    ["_info"]=>
    array(24) {
      ["url"]=>
      string(101) "http://sdzimg.oss-cn-shanghai.aliyuncs.com/Uploads/file/20160728/756362c2072744e639016f9ec9d8d5e7.jpg"
      ["content_type"]=>
      NULL
      ["http_code"]=>
      int(200)
      ["header_size"]=>
      int(252)
      ["request_size"]=>
      int(505)
      ["filetime"]=>
      int(-1)
      ["ssl_verify_result"]=>
      int(0)
      ["redirect_count"]=>
      int(0)
      ["total_time"]=>
      float(0.518144)
      ["namelookup_time"]=>
      float(0.458695)
      ["connect_time"]=>
      float(0.464335)
      ["pretransfer_time"]=>
      float(0.464338)
      ["size_upload"]=>
      float(0)
      ["size_download"]=>
      float(0)
      ["speed_download"]=>
      float(0)
      ["speed_upload"]=>
      float(0)
      ["download_content_length"]=>
      float(0)
      ["upload_content_length"]=>
      float(0)
      ["starttransfer_time"]=>
      float(0.518106)
      ["redirect_time"]=>
      float(0)
      ["redirect_url"]=>
      string(0) ""
      ["primary_ip"]=>
      string(13) "139.196.65.25"
      ["certinfo"]=>
      array(0) {
      }
      ["method"]=>
      string(3) "PUT"
    }
    ["oss-request-url"]=>
    string(101) "http://sdzimg.oss-cn-shanghai.aliyuncs.com/Uploads/file/20160728/756362c2072744e639016f9ec9d8d5e7.jpg"
    ["oss-redirects"]=>
    int(0)
    ["oss-stringtosign"]=>
    string(112) "PUT


image/jpeg
Thu, 28 Jul 2016 14:04:29 GMT
/sdzimg/Uploads/file/20160728/756362c2072744e639016f9ec9d8d5e7.jpg"
    ["oss-requestheaders"]=>
    array(4) {
      ["Content-Type"]=>
      string(10) "image/jpeg"
      ["Date"]=>
      string(29) "Thu, 28 Jul 2016 14:04:29 GMT"
      ["Host"]=>
      string(35) "sdzimg.oss-cn-shanghai.aliyuncs.com"
      ["Authorization"]=>
      string(49) "OSS hkamX8BnokV1RVWh:I53Rtk2CvLYTn9ZNpxOXYASJwb0="
    }
  }
  ["body"]=>
  string(0) ""
  ["status"]=>
  int(200)
}

展开
收起
数豆者 2016-07-28 23:02:04 4960 0
1 条回答
写回答
取消 提交回答
  • 回 楼主(数豆者) 的帖子
    请确认上传的时候文件内容是否真的大于0,最好打印一些debug信息
    2016-08-02 10:26:04
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS快储存加密技术 立即下载