Comments (2)
Your issue is your-server-related. I tried your example with 188mb file on notebook with 16 GB RAM and it went thru PHP just fine. I guess that you are limited by hardware capability provided on your server.
Anyway, even if you would solve out of memory issue, Telegram API is not accepting uploaded files that big, as you can see here: https://core.telegram.org/bots/api#sending-files
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.
If you send file bigger than that, Telegram API will respond with:
413: Request Entity Too Large
And this library will throw this exception:
\unreal4u\TelegramAPI\Exceptions\ClientException: Request Entity Too Large #413
If you try something smaller (for example 2.9 MB) PHP will upload it correctly and Telegram will accept it as it should. Only solution that came up in my mind is using recently introduced Local Bot API Server, which increasing limit up to 2000 MB. According issue #129 it should be possible with this library but I didn't tested it, yet.
from telegram-api.
Very good answer @DJTommek ! Thanks for answering this!
from telegram-api.
Related Issues (20)
- Exception unreal4u\TelegramAPI\Exceptions\ClientException caught, message: Bad Request: chat not found HOT 3
- HTML doesn;t work for inline messages? HOT 1
- Issue: ❓ Support Question HOT 1
- Splitting too long messages into multiple messages HOT 2
- installing use composer: Package amphp/artax is abandoned HOT 4
- ls HOT 1
- Undefined offset: 28 in /var/www/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php on line 95 HOT 3
- How can I get the result from GetChatAdministrators? HOT 1
- How can i set bot commands? HOT 2
- Sending requests HOT 2
- Implement Bot API v5.0
- Where is location to create configure information for my bot HOT 2
- How to use MessageEntity? HOT 1
- need to do some actions one by one HOT 2
- Generic error messages from API response
- copyMessage is not implemented ? HOT 1
- dependency amphp/artax no longer maintained
- テレグラム HOT 1
- InvalidArgumentException: Given URI "api.telegram.org" does not contain a valid host IP HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-api.