Agree with Yanick Girouard , gateway should be stateless, ie. it should not save any thing, but it can route to some where you want, for example, jdbc to database, route via ftp/ssh2 assertion to (s)ftp server, etc.
But still, routing big files is not recommended, (the default message size limit is 2.5MB), if you have to, setup separate gateway cluster for that.