Somewhere in cloudflare (maybe under Speed/optimization?) you should turn off all of cloudflare’s optimizations. And somewhere here are some topics that discuss it, though at first glance finding ones that have actual solutions is not easy. But maybe google “disable cloudflare optimizations”.
Is your DDOS issue real or imagined? Discourse has by default rate limiting (which won’t help with DDOS that’s very distributed). If you’re running a community that attracts DDOS folks then you should know that running Discourse in a way that the IP address isn’t leaked is pretty tricky.
All that to say that I’m currently working on something that has cloudflare using the orange cloud. I’ll double-check that uploads are working.
EDIT: Oh, but I was using direct uploads, not S3 uploads.