Giter Site home page Giter Site logo

Comments (2)

DJTommek avatar DJTommek commented on June 2, 2024

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.

unreal4u avatar unreal4u commented on June 2, 2024

Very good answer @DJTommek ! Thanks for answering this!

from telegram-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.