<?php
// 测试PHP 7.3兼容版上传API
$url = 'http://17yqhl.cn/api/upload_video_php73.php';

echo "测试URL: $url\n\n";

// 测试上传文件
$filePath = 'videos/opening/6a33c14d88a55.mp4';
if (!file_exists($filePath)) {
    echo "测试文件不存在!\n";
    exit;
}

echo "使用测试文件: $filePath\n";
echo "文件大小: " . filesize($filePath) . " bytes\n\n";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
$postData = array(
    'video' => new CURLFile($filePath, 'video/mp4', 'test.mp4'),
    'video_type' => 'host',
    'video_name' => 'PHP73测试'
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);

echo "HTTP状态: $httpCode\n";
echo "CURL错误: $error\n";
echo "响应:\n$response\n";
?>