On 6/11/07, Paul Simon <[EMAIL PROTECTED]> wrote:
> > Is it impossible to set the Content-Type? Any suggestions?
>
> It is impossible to set Content-Type using mod_headers. All the
> standard HTTP protocol headers are controlled by the apache core and
> can't be overriden with mod_headers.
>
> But you can set Content-Type using any of the standard apache
> content-type-controlling directives. In your case, you can simply use
> the T= flag to mod_rewrite, which is much more direct anyway.
>
I set the T= flag. In the rewrite log I see the flag doing it's thing:
...rewrite index.php -> /sesp/static/cache/sesp-apprv.csv
...remember /sesp/static/cache/sesp-apprv.csv to have MIME-type
'application/ms-excel'
but Content-Type comes back as text/plain instead of application/ms-excel. I'm
wondering if the
PT flag is causing other modules to override the T= flag. What do you think?
PT might be the culprit. You can perhaps avoid PT by rewriting to a
complete unix path. But the problem might also be that T= doesn't work
in .htaccess files. I haven't tried it myself, so I couldn't say.
RewriteRule (index.php|^)$ %{ENV:SESP_LOC}/static/cache/sesp-apprv.csv
[T=application/ms-excel,PT,L]
At this point, I'm thinking, leave the content type as the default text/plain.
Let the browsers
handle content-disposition "attachment; filename=sesp-apprv.csv" as they see
fit ;-)
Why don't you just unconditionally set .csv to the right content-type:
AddType application/ms-excel .csv
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]