Я пытаюсь загрузить видео на сервер cdn (сервер hwcdn.net) через API, но получаю следующую ошибку." 0470 Неверное имя файла (AZ, az, 0-9, -, _, ',.) "
//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;
}