As @Caboose12000@lemmy.world already said, I'd recommend drop.lol (can be selfhosted). Filetransfers are direct between peers (unless you're behind some hardcore NAS where UDP hole-punching via STUN is not possible).
I mean how I transfer a file depends on the situation. If it's to someone on XMPP I'd just establish a direct transfer there. Sometimes I share a directory over HTTP, FTP, SFTP and so on. The easiest way for most people, because it only requires a WebRTC capable browser, is with one of the many peer to peer filesharing platforms like drop.lol.