W dniu 08.07.2011 12:41, Krishnakant Mane pisze:
hello all,
I am using pylons 0.9.7 for developing my application.
It is an accounting software and I need to return back an ods file to be downloaded by the user.
But even after trying fileapp I can't get thihngs to work.
Can some one give me any idea as to what I must do?
All I need is to have the response set in such a way that the browser open the download dialog and let the user decide where to download/ open on the local machine.
Happy hacking.
Krishnakant.

Hi.
You have to set MIME type on Response object according to the file type. Look at WebOb.Response documentation on how to set headers. Required headers (at least) are probably:
Content-Type: YOU_MIME_TYPE
Content-Transfer-Encoding: binary
Content-Description: File Transfer
Content-Disposition: attachment; filename=YOUR_FILE_NAME

Also you should look at "Pragma: no-cache" and Cache-Control headers. Look it up.

Regards,
Karol Tomala

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to