
Yes, it is possible to file bankruptcy today to stop the foreclosure sale tomorrow. Although you are going to be facing a steep uphill battle to make your case work any time you show up to an attorney's office on the eve of foreclosure. I personally do not take cases like that.
It usually takes at least a few weeks to property prepare a bankruptcy case for filing. While it won't help with your immediate situation, the following article may be illuminating to others:
http://bklaw.com/bankruptcy-blog/2011/10/stopping-foreclosure-with-bankruptcy/
I hope it works out for you. Good luck.
Mark J. Markus, Attorney at Law
Handling exclusively bankruptcy law cases in California since 1991.
bankruptcy blog: http://bklaw.com/bankruptcy-blog/
Follow Me on Twitter: @bklawr