On 8 Mar 2010, at 14:43, Charles Oliver Nutter wrote: > On Mon, Mar 8, 2010 at 5:30 AM, Hongli Lai wrote: >> On Mar 8, 12:26 pm, Hongli Lai wrote: >>> Charles's middleware looks simple enough. I approve. >> >> Sorry. I mean Eric's. :) >> >> Another thing that you might want to keep in mind is that users might >> File.rename() a certain Tempfile, in which case you will not want to >> unlink it. For example suppose one uploads a large file to the web >> server, I think there are web apps out there that will simply rename() >> the tempfile to the storage directory and therefore avoid an expensive >> copy operation. > > I don't think it should be specified behavior that a tempfile *ever* > exists on disk. The mechanism of temporary storage for a large > incoming post should be a black box. Consider systems that won't > actually have a writable filesystem, like GAE; there, the "tempfile" > data would be stored in memory or in BigTable. > > Rack should not require that large multipart posts or anything else > require a filesystem, nor guarantee that they'll be on any filesystem > that exists. It's for this reason that I'd prefer to see this handled correctly by servers +/ handlers in general. Middleware may use what it likes, but it takes responsibility for cleanup of whatever it creates. > > - Charlie