Skip to content

Commit d43f26e

Browse files
committed
Merge branch 'develop'
2 parents 76bc05f + 95cee68 commit d43f26e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

upyun.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ public function delete($path) {/*{{{*/
128128
/**
129129
* 上传文件
130130
* @param string $path 存储路径
131-
* @param boolean $auto_mkdir 自动创建目录
132131
* @param mixed $file 需要上传的文件,可以是文件流或者文件内容
132+
* @param boolean $auto_mkdir 自动创建目录
133133
* @param array $opts 可选参数
134134
*/
135135
public function writeFile($path, $file, $auto_mkdir = False, $opts = NULL) {/*{{{*/
@@ -267,6 +267,8 @@ protected function _do_request($method, $path, $headers = NULL, $body= NULL, $fi
267267
curl_setopt($ch, CURLOPT_INFILESIZE, $length);
268268
}
269269
else {
270+
$length = @strlen($body);
271+
array_push($_headers, "Content-Length: {$length}");
270272
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
271273
}
272274
}

0 commit comments

Comments
 (0)