Skip to content

Commit

Permalink
Merge pull request #97 from rwifeng/demo
Browse files Browse the repository at this point in the history
replace __file__
  • Loading branch information
longbai committed Nov 5, 2014
2 parents 4adfb0d + c379afe commit 2dd48db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 32 deletions.
27 changes: 0 additions & 27 deletions demo/download_token.php

This file was deleted.

16 changes: 16 additions & 0 deletions demo/get_policy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
require_once('../qiniu/rs.php');
require_once('../qiniu/auth_digest.php');

$gpy = new Qiniu_RS_GetPolicy();

$url = 'http://sslayer.qiniudn.com/dive-into-golang.pptx';
echo $gpy->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);
2 changes: 1 addition & 1 deletion demo/up.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

$bucket = 'rwxf';
$key = 'up.php';
$file = __FILE__; //path to local file
$file = <path_to_local_file>;


$client = new Qiniu_MacHttpClient(null);
Expand Down
5 changes: 1 addition & 4 deletions qiniu/io.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2dd48db

Please sign in to comment.