Skip to content

Commit

Permalink
百度新域名
Browse files Browse the repository at this point in the history
  • Loading branch information
oott123 committed Jul 23, 2013
1 parent ab4534a commit dfb52bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _bpcs_files_/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function get_quota($access_token){
}
function upload_file($access_token,$path,$localfile,$ondup='newcopy'){
$path='/apps/'.urlencode(file_get_contents(CONFIG_DIR.'/appname').'/'.$path);
$url = "https://pcs.baidu.com/rest/2.0/pcs/file?method=upload&access_token=$access_token&path=$path&ondup=$ondup";
$url = "https://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&access_token=$access_token&path=$path&ondup=$ondup";
$add = "--form file=@$localfile";
$cmd = "curl -X POST -k -L $add \"$url\"";
$cmd = cmd($cmd);
Expand Down
2 changes: 1 addition & 1 deletion bpcs_uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
die();
}
$path='/apps/'.urlencode(file_get_contents(CONFIG_DIR.'/appname').'/'.$argv[3]);
$cmd = 'wget --no-check-certificate -O "'.$argv[2].' " "https://pcs.baidu.com/rest/2.0/pcs/file?method=download&access_token='.$access_token.'&path='.$path.'"';
$cmd = 'wget --no-check-certificate -O "'.$argv[2].' " "https://d.pcs.baidu.com/rest/2.0/pcs/file?method=download&access_token='.$access_token.'&path='.$path.'"';
cmd($cmd);
break;
case 'delete':
Expand Down

0 comments on commit dfb52bd

Please sign in to comment.