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 file [Feature] #9

Closed
cosecantt opened this issue Sep 23, 2015 · 8 comments
Closed

Download file [Feature] #9

cosecantt opened this issue Sep 23, 2015 · 8 comments

Comments

@cosecantt
Copy link

Hi Ilya, any idea to add file download feature using curl to the script?
Like downloadFile();

@iGusev
Copy link
Contributor

iGusev commented Sep 23, 2015

See Release 2.2.0 and official docs

@iGusev
Copy link
Contributor

iGusev commented Sep 23, 2015

or you want additional method downloadFile()?

@cosecantt
Copy link
Author

Yes additional downloadFile() method. Now I can only get the url by getFile() method. But need somehow integrated efficient way. Then there will be no need to write a separate download script. I saw same additional download feature in python libraries. Thank you for quick reply.
e.g:
$file = $bot->getFile($fileId);
$file->download(path/to/my/server/filename);

@iGusev
Copy link
Contributor

iGusev commented Sep 23, 2015

Implemented in 2.2.1. Now you can get the file's contents via downloadFile($fileId), but how to store the contents is not a problem of this library. I'm reccomend use Flysystem.

@cosecantt
Copy link
Author

Ilya, I couldn't find downloadFile($fileId) method in the latest commits or am I missing something?
Thank you for Flysystem recommendation. I will definitely check it out.

@iGusev
Copy link
Contributor

iGusev commented Sep 23, 2015

Just set your composer.json:

"require": {
    "telegram-bot/api": ">=2.2.1"
  },

or:

"require": {
    "telegram-bot/api": "dev-master"
  }

@iGusev
Copy link
Contributor

iGusev commented Sep 24, 2015

Sorry, it's my fail. I forgot to do a push. Fixed

@cosecantt
Copy link
Author

Ok it works now. Thank you.

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

2 participants