From c379afeeb97401b7f3a8225ca93301d531a598e9 Mon Sep 17 00:00:00 2001 From: rwifeng Date: Wed, 5 Nov 2014 14:33:22 +0800 Subject: [PATCH] replace __file__ --- demo/download_token.php | 27 --------------------------- demo/get_policy.php | 16 ++++++++++++++++ demo/up.php | 2 +- qiniu/io.php | 5 +---- 4 files changed, 18 insertions(+), 32 deletions(-) delete mode 100644 demo/download_token.php create mode 100644 demo/get_policy.php diff --git a/demo/download_token.php b/demo/download_token.php deleted file mode 100644 index f282a247..00000000 --- a/demo/download_token.php +++ /dev/null @@ -1,27 +0,0 @@ -MakeRequest($url, null); + +echo "\n"; +$url = 'http://sslayer.qiniudn.com/dive-into-golang.pptx?odconv/pdf'; +echo $gpy->MakeRequest($url, null); + +echo "\n"; +$url = 'http://sslayer.qiniug.com/2.m3u8'; +echo $gpy->MakeRequest($url, null); diff --git a/demo/up.php b/demo/up.php index 3f52e257..1b7b2fab 100644 --- a/demo/up.php +++ b/demo/up.php @@ -5,7 +5,7 @@ $bucket = 'rwxf'; $key = 'up.php'; -$file = __FILE__; //path to local file +$file = ; $client = new Qiniu_MacHttpClient(null); diff --git a/qiniu/io.php b/qiniu/io.php index d77a03bf..d150938a 100644 --- a/qiniu/io.php +++ b/qiniu/io.php @@ -70,10 +70,7 @@ function Qiniu_PutFile($upToken, $key, $localFile, $putExtra) // => ($putRet, $e } $fields = array('token' => $upToken, 'file' => createFile($localFile, $putExtra->MimeType)); - if ($key === null) { - $fname = '?'; - } else { - $fname = $key; + if ($key !== null) { $fields['key'] = $key; } if ($putExtra->CheckCrc) {