I am using telegram API and create php telegram bot. For sending video file with sendVideo
method, use file_id
like BAADBAADbwADhd7gCEpUooz4V5Q1Ag
. But after some days this file_id
not worked and I have to upload this video file again. What is the problem?
Asked
Active
Viewed 4,120 times
3

amin roshani
- 389
- 4
- 11
2 Answers
5
as you can read in this link:
Can I count on file_ids to be persistent?
For the moment, file_ids for your bot's outgoing files may be recycled after several thousand files have been sent. This may be changed in the future. Inbound file_ids can be treated as persistent.
so if you send a file from your server to telegram user (over the bot), the returned file_id
can't be permanent. you can forward the file from user to bot and save file_id
instead of that.

علیرضا
- 2,434
- 1
- 27
- 33
-
7That FAQ section has been updated, now (February 2018) it [says](https://core.telegram.org/bots/faq#can-i-count-on-file-ids-to-be-persistent): `Yes, file_ids can be treated as persistent.` – Meloman Feb 06 '18 at 14:51
-
thanks @Meloman. yes the FAQ updated. but there is serious concern about files after one million! because currently **a user** and **a channel** in telegram, can't contain more than1 million files. BOT maybe too! – علیرضا Feb 07 '18 at 15:14
-
علیرضا forwarded id to bot are same with sended id to my user, and my id not work after some days. – Saeed Heidarizarei May 30 '18 at 08:54
-
1@SedricHeidarizarei yes, unfortunately the `forwarded` post to bot is not permanent except the post forwarded from a channel to bot not from a person. – علیرضا May 31 '18 at 09:45
-
Then Should I upload to a channel first and after that to bot? This way is permanent? Can I upload a 100 MG file and get permanent file id too? – Saeed Heidarizarei May 31 '18 at 13:33
-
@SedricHeidarizarei yes i use this thechnique for more that 2 years! but note that each channel can not contain more that 1 milion post!! – علیرضا Jun 01 '18 at 21:18