Increase swap space.

But you probably don't need to store the whole file. Just store bits of it, or summarise the contents in some way. Without knowing what's in the file it's impossible to say how in any more detail.