I want to Send a video to Telegram with bot using multipart/form-data I use below codes, It works for files smaller than 20MB but doesn't work for files larger than 20MB but Telegram API reference says:
Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
$chatId=1111111;
$video=urlencode("http://video/mp4");
$botToken = "mytoken";
$webSite = "https://api.telegram.org/bot" . $botToken;
$url = $webSite. "/sendVideo";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, "Content-Type: multipart/form-data;charset=utf-8");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "chat_id=$chatId&video=$video");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close ($ch);
var_dump($output); // show output
The result that I get in the browser is:
"{"ok":false,"error_code":400,"description":"Bad Request: wrong file identifier/HTTP URL specified"}"
I've tried for two different videos in the same host it works for the file that is smaller than 20MB but doesn't work for another one which is 35 MB.