if you are willing to go for ESPAsncWebServer (assuming you are on an ESP) then you can look at my "tutorial " Uploading various byte streams to an ESP32 using ESPAsncWebServer
you'll get a byte stream, then it's just a matter of opening the file you want to dump the stream into.