file in here https://bin.nixnet.services/?b7524743589bc2c9#HCMof8cFV8DfNLvY5vMmxmK6hDkahaZDTdvCyn1jg3jC
What you need is a buffer. You can use the io.BytesIO class in the standard library for that: https://docs.python.org/3/library/io.html?highlight=io#io.BytesIO
Umm tqs but exactly my question is not only that ig. If user sends image nor documents i have to differentiate between them. How to know the file name which user sends nor how to chk whether it is a document or image or any other media? 🧐
https://bfy.tw/TAuY
How do u chk file extension without knowing it's name or any attribute of it? 🙄
How many links did you check?
How would you not know the name and the file extension?
https://t.me/c/1111136772/193260 idk i am blindly opening an MP3 file and writing content. Idk how to get which type of file is being uploaded.
Yep. Most of the links which u linked shows the way to get file extension if any file name not path is specified. Sorry if I am wrong nor blind. My requirement is to get the file name which is being uploaded. And also this https://t.me/c/1111136772/193287
I don't have any experience with aiohttp but the docs here: https://docs.aiohttp.org/en/stable/multipart.html#reading-multipart-responses clearly state that there's a helper field called filename.
Did you not read the docs before asking your question? They give you an example of how to do it, https://docs.aiohttp.org/en/stable/web_quickstart.html#file-uploads
I suppose your problem was solved, but, just in case, https://www.adamsmith.haus/python/answers/how-to-check-the-type-of-a-file-in-python That link was the 2nd result of https://t.me/c/1111136772/193277
Обсуждают сегодня