Giter VIP home page Giter VIP logo

Comments (11)

levlam avatar levlam commented on July 18, 2024

Using both HTTP and HTTPS

This wouldn't work, because in local mode you can "Upload files up to 2000 MB". Sending a file using its HTTP URL is not a file uploading. Such files are downloaded by the Telegram servers from the specified URL and there is no way --local flag can change limits on their size.

URI Scheme: file://path/to/file.jpg with both absolute and relative path, hitting {"ok":false,"error_code":400,"description":"Bad Request: realpath failed for <path to file>"}

The provided path is wrong as the error message suggest. The error message includes the wrong path, so you should clearly see the error. You can find examples of valid file URI in https://en.wikipedia.org/wiki/File_URI_scheme#Examples.

from telegram-bot-api.

Nickelza avatar Nickelza commented on July 18, 2024

Solved. I added "/" to the real file path, making it file:///<absolute path to file.jpg>, in my case file:///var/www/....

from telegram-bot-api.

Nickelza avatar Nickelza commented on July 18, 2024

I stand corrected. A new error arises: {"ok":false,"error_code":400,"description":"Bad Request: stat for file \"<path to file>" failed"}

from telegram-bot-api.

levlam avatar levlam commented on July 18, 2024

The file is still not accessible. Check access rights of the file.

from telegram-bot-api.

mrbesen avatar mrbesen commented on July 18, 2024

Does it work with files smaller than 20MB?

from telegram-bot-api.

levlam avatar levlam commented on July 18, 2024

@mrbesen The error isn't related in any way to size of the file. The file doesn't exist or there are no enough rights to access it.

from telegram-bot-api.

mahdirahimi1999 avatar mahdirahimi1999 commented on July 18, 2024

@Nickelza Was your problem solved?

from telegram-bot-api.

Nickelza avatar Nickelza commented on July 18, 2024

The file is still not accessible. Check access rights of the file.

I'm afraid you're right, still trying to figure it out

from telegram-bot-api.

Nickelza avatar Nickelza commented on July 18, 2024

Does it work with files smaller than 20MB?

No

from telegram-bot-api.

Nickelza avatar Nickelza commented on July 18, 2024

@Nickelza Was your problem solved?

Not yet, but I think I've more or less understood what to fix, just not how to fix it. The user that is used to access the script (www-data) isn't able to view upper level folders, so a realpath is more or less meaningless to it (I confirmed this by verifying the PHP realpath function returns false). So now I just have to figure out how to give www-data executable permission for upper folders without changing their ownership or making them 777

from telegram-bot-api.

Nickelza avatar Nickelza commented on July 18, 2024

All solved. As @levlam initially stated, it was a problem with permissions. The permission of the last folder inside of which the file to send was had executable permission set only for the owner, I set it for all (711). This definitely fixed the issue. Thanks for the help @levlam and @mrbesen for chipping in too.

from telegram-bot-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.