I saw sharrr the other day which apparently can be self hosted and uses cryptography / expiracy / single download / multi part downloads to make it hard to find a compete file if an attacker even has host access, it also encrypts the file prior to uploading to the server and only you on the client side have the encryption.
That said, this is all according to the architecture of the service, not sure about security in practice.
This is a nice tool though using it I think triggered my IP to be flagged with Cloudflare when I was trying to fix an issue with my instance and lemmy.ml.