Skip to content

Commit 2dd48db

Browse files
committed
Merge pull request #97 from rwifeng/demo
replace __file__
2 parents 4adfb0d + c379afe commit 2dd48db

File tree

4 files changed

+18
-32
lines changed

4 files changed

+18
-32
lines changed

demo/download_token.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

demo/get_policy.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
require_once('../qiniu/rs.php');
3+
require_once('../qiniu/auth_digest.php');
4+
5+
$gpy = new Qiniu_RS_GetPolicy();
6+
7+
$url = 'http://sslayer.qiniudn.com/dive-into-golang.pptx';
8+
echo $gpy->MakeRequest($url, null);
9+
10+
echo "\n";
11+
$url = 'http://sslayer.qiniudn.com/dive-into-golang.pptx?odconv/pdf';
12+
echo $gpy->MakeRequest($url, null);
13+
14+
echo "\n";
15+
$url = 'http://sslayer.qiniug.com/2.m3u8';
16+
echo $gpy->MakeRequest($url, null);

demo/up.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
$bucket = 'rwxf';
77
$key = 'up.php';
8-
$file = __FILE__; //path to local file
8+
$file = <path_to_local_file>;
99

1010

1111
$client = new Qiniu_MacHttpClient(null);

qiniu/io.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ function Qiniu_PutFile($upToken, $key, $localFile, $putExtra) // => ($putRet, $e
7070
}
7171

7272
$fields = array('token' => $upToken, 'file' => createFile($localFile, $putExtra->MimeType));
73-
if ($key === null) {
74-
$fname = '?';
75-
} else {
76-
$fname = $key;
73+
if ($key !== null) {
7774
$fields['key'] = $key;
7875
}
7976
if ($putExtra->CheckCrc) {

0 commit comments

Comments
 (0)