#Multipart

It astounds me that so many companies - large, well-funded companies whose businesses utterly depend on email communications with their customers - so frequently send me multipart/alternative email containing a multi-megabyte text/HTML part, and a completely blank text/plain part.

For those of you who aren't email and MIME nerds, the MIME type declaration "multipart/alternative" means "here are message parts containing more than one presentation of the same information, so show the user whichever one is most appropriate for them".

And so users like me, who use a plaintext/console mail reader, or who have a preference for plain text selected in their reader, open a message like this and are greeted by a completely blank message.

Well done, Company! Excellent, no notes.

Maybe you should hire someone who cares about and understands email standards? Hint, hint - I'm available.

#email #MIME #multipart #MultipartAlternative #TextHTML #TextPlain #plaintext #standards #incompetent #incompetence

2025-07-17

Spring boot, многопоточка и магия вне хогвартса

Всем привет! Меня зовут Алексей, и я работаю Java‑разработчиком с 2018 года. В статье расскажу, как столкнулся с проблемой обработки MultipartFile в многопоточном режиме. Почему эта проблема возникает и какие решения существуют. Изначально стояла задача организовать фоновую обработку Excel-файлов: принимать файл, мгновенно возвращать клиенту HTTP-200 (без данных), а обработку содержимого выполнять асинхронно в отдельном потоке. Вроде задачка тривиальная. Делаем контроллер:

habr.com/ru/companies/rostelec

#springboot #java #multithreading #multipart

#Email will always be plain #text.

But some companies ...

Return-Path: <bounces-456@bouncesp.monster.com>
Received: [...]
Subject: [...]
To: [...]
Content-Type: multipart/alternative; boundary="_----9kSRfd7Enun64iOZEIFzXw===_B6/5E-12157-1C57EE76"
[...]

--_----9kSRfd7Enun64iOZEIFzXw===_B6/5E-12157-1C57EE76
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

--_----9kSRfd7Enun64iOZEIFzXw===_B6/5E-12157-1C57EE76
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "w3.org=
[...]

Well played, Monster / monster.com.

#PlainText #rfc822 #MIME #multipart #incompetence #testing #rfc2822 #rfc2045 #rfc2046 #rfc1341 #MultipartAlternative

Paolo Melchiorrepaulox@fosstodon.org
2025-01-20

TIL Network protocols Sans I/O ⚡

“… network protocol implementations written in Python that perform no I/O (this means libraries that operate directly on text or bytes; this excludes libraries that just abstract out I/O).” 🤯

Read the reference page 👇
sans-io.readthedocs.io/

#Reusability #Python #FastCGI #HTTP2 #H11 #IRC #OAuth2 #OAuthLib #WebSocket #SOCKS5 #RFC2217 #SerialOverIP #EPICS #FIX #QUIC #LanguageServerProtocol #SMTP #DBus #ThorlabsAPT #Matrix #SSL #TLS #CPython #multipart #formdata

2024-12-28

My #Python #multipart form-data #parser #benchmark got an upgrade: new test scenario, new library, and lots of version updates -> github.com/defnull/multipart_b

2024-10-17

I get the feeling that many web #API designers avoid #multipart file uploads because in most frameworks and also client libraries, it sucks. But it does not have to. It's actually the best we have to transfer multiple files in one request and also quite efficient when using a sane parser or modern browsers. It just has a bad reputation from complicated and slow parsers written for emails that have to carry decades of technical depth. Modern HTML5 multipart/form-data is not the same thing.

Jezus Michał "Le Wzdych" (on)mgorny@pol.social
2024-10-08

A mówiłem sobie, że będę pisał ogólnie o problemach, zamiast pokazywać palcami konkretne projekty, ale takie podejście zdaje się mieć więcej sensu przy pomyłkach niż przy celowym, szkodliwym zachowaniu. Tak więc…

Tasiemiec się ciągnie. Dwie paczki na #PyPI, #multipart i python-multipart, roszczą sobie prawa do nazwy modułu Pythona "multipart". Autorzy obydwu argumentują, każdy na swoją korzyść, żaden nie chce ustąpić, a ostatecznie proponują ten sam kompromis: włączanie zależności w kod. Z tą tylko różnicą, że jeden sugeruje, że kiedyś włączy swoją wersję w swoją popularną paczkę (w bliżej nieokreślonej przyszłości), a drugi sugeruje, by inne paczki w międzyczasie włączały potrzebną im wersję.

Mamy tu całkiem sporą szkodę. Najpierw ludzie zaczynają używać w swoim projekcie jednej z paczek. Następnie dowiadują się, że właśnie wprowadzili konflikt zależności. I jedyne wyjście z sytuacji, to włączyć jakąś wersję jednej z paczek. A pewnego dnia powstały bajzel będzie trzeba uprzątnąć.

Rzecz jasna, pojawia się już poszukiwanie rozwiązań technicznych na ten problem natury osobowej. Myślę, że sam zmienię nazwę w #Gentoo, i połatam wsteczne zależności, żeby już teraz móc zacząć pozbywać się włączanych zależności. Co za bajzel.

Na marginesie: jeżeli używacie teraz #starlette, możecie chcieć rozważyć bardziej przyjazne dla ekosystemu alternatywy.

github.com/pypa/packaging-prob

#Python

Jesus Michał "Le Sigh" 🏔 (he)mgorny@treehouse.systems
2024-10-08

I've told myself that I'm going to point out generic issues rather than point fingers at specific projects, but I guess that makes more sense for mistakes rather than deliberate harmful behavior, so…

The drama continues. The #multipart and python-multipart #PyPI packages both claim the #Python import name of "multipart". Both have arguments for their claims, both refuse to step down, and unsurprisingly, both reach the same compromise: vendoring. Except that one says they're eventually going to vendor it in their popular package (at some future time), while the other tells everyone to vendor the other package in the meantime.

The damage is quite deep here. First, people start using one of the packages. Then they learn that they've just introduced a potential dependency conflict. And the only thing that they can do now is start vendoring an arbitrary version of the package. And one day, someone will have to clean this mess up.

And of course, people are now looking for technical solutions to this disturbing social problem. In fact, I'll probably end up going for the rename-and-patch approach in #Gentoo to start unvendoring immediately. What a mess.

The bottom line is: if you're using #starlette, you may want to reconsider.

github.com/pypa/packaging-prob

2024-09-02

I rewrote my #foss implementation of a #python #multipart form data parser as a #sansio (push based #nonblocking ) parser, and it is now not only suitable for #async applications, but also 2x to10x faster than the old (blocking) implementation. Was a ton of work, but totally worth it. Release will follow later this week.

github.com/defnull/multipart/p

2024-01-08
Ænðr E. Feldstrawaeveltstra
2018-12-28

that the new .net.http and are not equipped to handle multipart/form-data out of the box. One has to generate and add their own form boundaries.

This is a problem for those of us who never needed to know the /1.1 and RFCs by heart, and had hoped that the tools built into the programming language's ecosystem would handle common use cases.

Which HTTP component do you use for multipart/form-data?

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst