wx.uploadFile 超时问题?
在测试小程序中,上传图片接口一切正常。
在正式小程序中 web调试工具上传图片正常、真机测试几百k的图片就上传超时
header("Content-Type:text/html;charset=utf8"); header("Access-Control-Allow-Origin: *"); //解决跨域 header('Access-Control-Allow-Methods:POST');// 响应类型 if ($_FILES["file"]["error"] > 0) { $rst['error'] = $_FILES["file"]["error"]; //保存失败 $rst["code"] = 201; $this->ajaxReturn($rst); } else {$user_id = I('post.userid');$name = 'life_photo_' . $user_id . time(); move_uploaded_file($_FILES["file"]["tmp_name"], getcwd() . "/Public/Uploads/life_photo/" . $name . '.png'); |
