Specify filename using rails Metal

Hi,

I'm using Rails Metal to serve certain files, But i don't know how to change the filename ...

Here is the code in Metal where i send the file : [200, { 'Content-Type' => file.content_type}, [file.read]]

I tried to specify 'filename'=>'test.zip'... but without success...

Anyone has a clue ?

Thanks, regards.

Hi,

I'm using Rails Metal to serve certain files, But i don't know how to change the filename ...

Here is the code in Metal where i send the file : [200, { 'Content-Type' => file.content_type}, [file.read]]

I tried to specify 'filename'=>'test.zip'... but without success...

Are you trying to set the name that the browser saves the file as? If so then you need to set a Content-Disposition header ( see http://www.ietf.org/rfc/rfc2183.txt )

Fred