Well it still seems pretty broken :p Given that "extract the filename from a header" seems like it shouldn't be very specific to the browser, maybe extract this into a function rather than copy/paste.