Похожие чаты

Anyone familiar with aiohttp. ?.how to get name of the

file in here https://bin.nixnet.services/?b7524743589bc2c9#HCMof8cFV8DfNLvY5vMmxmK6hDkahaZDTdvCyn1jg3jC

12 ответов

22 просмотра

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

Bread pup ▲⬤ ×▫︎
What you need is a buffer. You can use the io.Byte...

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? 🧐

Bread pup ▲⬤ ×▫︎
https://bfy.tw/TAuY

How do u chk file extension without knowing it's name or any attribute of it? 🙄

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.

Bread pup ▲⬤ ×▫︎
How many links did you check?

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ɴᴅʀᴀᴊɪᴛʜ • 🇮🇳 •
https://t.me/c/1111136772/193260 idk i am blindly ...

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.

Iɴᴅʀᴀᴊɪᴛʜ • 🇮🇳 •
Yep. Most of the links which u linked shows the wa...

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

Похожие вопросы

Обсуждают сегодня

Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
И никого не интересует какие пакеты кто использует. ((% Заходишь на сайт симфони и видишь поддержку Украины - по законам РФ это ж экстремизм. Только никто не отказывается от с...
Am Ambrion
11
Мне вот любопытно. Уже сколько времени имею соблазн купить макбук, ибо подозреваю что очень уж удобен будет в связке с другой техникой от эпл которая у меня есть, да и сам по ...
Not Yeromin
9
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Добрый день, подскажите, пожалуйста, по проблеме. Сегодня на работе утром обнаружилось что по рдп подключиться не получается к серверу 2022. В серверную зашел - на системно...
srv
19
лучше скажите, причём тут паскаль?
Alexey Kulakov
36
Карта сайта