Fogging with a natural pyrethrum solution, spraying with a synthetic pyrethroid such as talstar outside or using automatic insecticide dispensing machines inside will keep phorid flies in check. There are over 100,000 species of flies in the world. The common house fly is categorized as a filth fly because they breed in garbage, rotten food and manure. From egg to adult may only take 10 days. Many generations of flies will be produced in a short span of time.
Control is therefore ongoing.
Keep trash cans and dumpsters clean with the lids closed. Move dumpsters as far away from your house or business as possible. Keep pet manure picked up. These steps will eliminate their breeding sources. Seal any cracks around doors and windows where flies are entering.