Ya, the water is leaking in from somewhere, you are going to have to get that carpet and foam/insulation layer up and get everythign dried out, or you will end up with a permanent musty smell. Video
here to give you an idea Could take a day or days to get it to all dry out, hopefully you have a garage you can do this in so you can have the doors open, have it out of the weather and have a fan blow on it. And you need to find and fix the leak. I have heard of the corolla getting wet carpet from a failed seal on a tail light, the water gets past the seal, leaks into one of the holes in the frame of the car and flows to the floor board and carpet. Could be a seal on your windshield, rear window, etc. If your car has rust, if you live in the rust belt, you could have holes in the floor board where watter is splashing up and getting into the car. I see some of the 2004 corollas have the exterior antenna on the rear of the roof? That could be a source of a leak if the seal has gone bad over time.
The most common reasons I am coming across are a bad seal on the tail light or clogged up drain ports.
Check all your doors, open each one and wave it back and forth to see if you hear any sloshing, if so, might be a clogged drain at the bottom of that door that needs to be cleaned out.
Another common leak area on some cars, not sure if true for the 2004 corolla is at the top of the windshield, on the corner where you have the groove on the roof with the plastic trim where it comes down and meets the corner of the windshield.
You should have rubber pugs on the bottom of the car you can pop out to help drain the water, can be removed from under the car so you don't even have to pull up the carpet to get to them.
Other videos that might be helpful in your search for the source of the leak
Pics