Maybe you are interested in the secure-uploads feature. https://meta.discourse.org/t/secure-uploads/meta/140017?u=moin