On Dec 18, 2009, at 11:24 AM, mr.freeze wrote:

> When I host a .w2p file on Dreamhost, it tries to open in the browser
> with Firefox, displaying garbled binary data on the screen. I have
> tried this in my .htaccess file:
> 
> <Files *.w2p>
>  ForceType application/octet-stream
>  Header set Content-Disposition attachment
> </Files>
> 
> ...and...
> 
> AddType application/octet-stream .w2p
> 
> ...with no luck.  Can I control this through web2py? Sorry if this has
> been discussed already.

Assuming that the file is being served by web2py, I don't think that .htaccess 
is going to have any effect.

If you're serving the file dynamically (through a controller), you could try:

    response.headers['Content-Type'] = 'application/x-compressed-tar'

Or you could add this to CONTENT_TYPE in contenttype.py.

    '.w2p': 'application/x-compressed-tar',

(I think octet-stream is fine, too, but x-compressed-tar is how web2py serves 
.tgz files.)

--

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


Reply via email to