Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download files from not local mode #26

Closed
Poolitzer opened this issue Nov 8, 2020 · 5 comments
Closed

Download files from not local mode #26

Poolitzer opened this issue Nov 8, 2020 · 5 comments

Comments

@Poolitzer
Copy link

Poolitzer commented Nov 8, 2020

The file path is like documents/file_5, but I cant figure out how to download it. It doesn't work like the cloud API suggests, I am getting a 404 not found error then. Am I missing something?

@levlam
Copy link
Contributor

levlam commented Nov 8, 2020

After getFile request the downloaded files are stored locally in the server working directory under the path returned in getFile response. After that the files can be served from that directory using any HTTP-server suitable for serving static files.

@Poolitzer
Copy link
Author

so I have to run a separate process for serving the files, alright. Thanks for clearing that up.

@levlam
Copy link
Contributor

levlam commented Nov 8, 2020

@Poolitzer Yes. But you can usually use the same process, which is used as a TLS-terminating proxy.

@TopperBG
Copy link

Could be I miss something, but in that construction .getFile() returns me file_paht in form:
http://nginx:88/file/botTOKEN//var/lib/telegram-bot-api/TOKEN/documents/file_17.exe
Obviously doubled path and somekind concatenated ?
@Poolitzer how did you manage to get local file trough API ?

@levlam
Copy link
Contributor

levlam commented Apr 26, 2023

@TopperBG
Local Bot API server returns only "/var/lib/telegram-bot-api/TOKEN/documents/file_17.exe". It is your Bot API library, who adds the rest, because it doesn't know that the server is run in a local mode.

deus-developer pushed a commit to deus-developer/telegram-bot-api that referenced this issue Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants