Skip to content

Commit 633dc05

Browse files
committed
resumable_io: api from rs-mkfile to mkfile
1 parent 483d7ce commit 633dc05

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

qiniu/resumable_io.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ function Qiniu_Rio_Mkblock($self, $host, $reader, $size) // => ($blkputRet, $err
5959
return Qiniu_Client_CallWithForm($self, $url, $body, 'application/octet-stream');
6060
}
6161

62+
6263
function Qiniu_Rio_Mkfile($self, $host, $key, $fsize, $extra) // => ($putRet, $err)
6364
{
64-
$entry = $extra->Bucket . ':' . $key;
65-
$url = $host . '/rs-mkfile/' . Qiniu_Encode($entry) . '/fsize/' . $fsize;
66-
65+
$url = $host . '/mkfile/' . $fsize;
66+
if ($key !== null) {
67+
$url .= '/key/' . Qiniu_Encode($key);
68+
}
6769
if (!empty($extra->MimeType)) {
6870
$url .= '/mimeType/' . Qiniu_Encode($extra->MimeType);
6971
}
@@ -74,7 +76,7 @@ function Qiniu_Rio_Mkfile($self, $host, $key, $fsize, $extra) // => ($putRet, $e
7476
}
7577
$body = implode(',', $ctxs);
7678

77-
return Qiniu_Client_CallWithForm($self, $url, $body, 'text/plain');
79+
return Qiniu_Client_CallWithForm($self, $url, $body, 'application/octet-stream');
7880
}
7981

8082
// ----------------------------------------------------------
@@ -122,7 +124,7 @@ function Qiniu_Rio_Put($upToken, $key, $body, $fsize, $putExtra) // => ($putRet,
122124
}
123125

124126
$putExtra->Progresses = $progresses;
125-
return Qiniu_Rio_Mkfile($self, $host, $key, $fsize, $putExtra);
127+
return Qiniu_Rio_Mkfile($self, $QINIU_UP_HOST, $key, $fsize, $putExtra);
126128
}
127129

128130
function Qiniu_Rio_PutFile($upToken, $key, $localFile, $putExtra) // => ($putRet, $err)

0 commit comments

Comments
 (0)