如何把文件cdn服务器上,如何在cdn服务器上上传视频文件?

我试图通过api在cdn服务器(hwcdn.net服务器)上传视频,但得到以下错误。 “0470无效的文件名(包括AZ,az,0-9, – ,_,',.)”如何在cdn服务器上上传视频文件?

//PHP example code for calling an action:

$action = "UF"; //get system info

$user = "xxxxxx"; //my StrikeTracker user name

$pass = "xxxxxx"; //my StrikeTracker password

$apiKey ="xxxxxxxxxxxxxxxxxxxx"; //my API Key

$md5pass = md5($pass);

$queryString = "action=$action&user=$user&key=$apiKey&password=$md5pass";

$token =md5($queryString);

$directory="/folder path/";

$Filedata="testingvideo.flv";

echo $apiQuery = "action=$action&user=$user&token=$token&directory=$directory&Filedata=$Filedata";

$host="http://st-api.hwcdn.net/index.php";

echo do_post_request($host,$apiQuery);

function do_post_request($url, $data, $optional_headers = null)

$params = array('http' => array(

'method' => 'POST',

'content' => $data

));

if ($optional_headers !== null) {

$params['http']['header'] = $optional_headers;

$ctx = stream_context_create($params);

$fp = @fopen($url, 'rb', false, $ctx);

if (!$fp) {

throw new Exception("Problem with $url, $php_errormsg");

$response = @stream_get_contents($fp);

if ($response === false) {

throw new Exception("Problem reading data from $url, $php_errormsg");

return $response;

原文链接:https://blog.csdn.net/weixin_36081187/article/details/119309195?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165918321816782388046054%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165918321816782388046054&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-18-119309195-null-null.nonecase&utm_term=cdn

原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/283

(0)
上一篇 2022年8月4日 20:07
下一篇 2022年8月4日 20:33

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

优速盾注册领取大礼包www.cdnb.net
/sitemap.xml