mod_headers/files compatibility

IrPr

Well-Known Member
#1
Hi there
I've planned to force WMV files to be downloaded instead of stream by Windows Media Player in some IE browsers without Download Managers

should add some special response Headers when it requests WMV files
This is my Apache configuration which works charmly:
Code:
<Files "\.(wmv|WMV)$">  
  Header add Content-Description "File Transfer"
  Header add Content-Type        "video/x-ms-wmv"
  Header add Content-Disposition "attachment"
</Files>
But when i add this into LSWS Apache Style configurations doesnt work properly
no any extra response headers will be added

Whats wrong? something with my configurations? or it doesnt support Files or Header directives?

Thanks LSWS Developers, specially Geroge that i know he will answer n probably solve this issue:D
 
Last edited:

IrPr

Well-Known Member
#2
Edit:
I've tried SetEnvIf instead, but still same problem, no header will be added
Code:
SetEnvIf Request_URI "\.wmv$" requested_wmv=wmv 
Header add Content-Description "File Transfer" env=requested_wmv 
Header add Content-Disposition "Attachment"    env=requested_wmv
Seems to be Header directive incompatibility to me, but it supports, George said here

PS: i dont restart whole LSWS, just gracefully restart, aint need inital daemon restart to apply?
 
Last edited:

IrPr

Well-Known Member
#7
Try header add in .htaccess, if the whole directory hold wmv, get rid of the "<files...>"
Header directive in htaccess is working well:

.htaccess:
Code:
Header add Content-Description "File Transfer"
#Header add Content-Type       "video/x-ms-wmv"
Header add Content-Disposition "attachment"
Request:
Code:
GET /test/wmv HTTP/1.1
Host: localhost
Response header:
Code:
HTTP/1.1 200 OK
Date: Wed, 30 Jul 2008 09:58:12 GMT
Server: LiteSpeed
Accept-Ranges: bytes
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
ETag: "a6eb915-4804c40d-1cc8118"
Last-Modified: Tue, 15 Apr 2008 15:04:45 GMT
Content-Type: application/octet-stream
Content-Length: 175028501
Content-Description: File Transfer
Content-Disposition: attachment
But no way to set any condition, <Files> or SetEnfIf
would be implemented please?

PS: Files directive isnt supported in htaccess files by httpd, just global/vh configurations
 

IrPr

Well-Known Member
#9
Thanks for reply, but still doesnt work properly with Files directive

This is my .htaccess, setting both REGEX and PLAIN conditions
Code:
<Files "\.(wmv|WMV)$">
  Header add Content-Description "File Transfer"
#  Header add Content-Type        "video/x-ms-wmv"
  Header add Content-Disposition "attachment"
</Files>
<Files "*.wmv">
  Header add Content-Description "File Transfer"
#  Header add Content-Type        "video/x-ms-wmv"
  Header add Content-Disposition "attachment"
</Files>
While this .htaccess adds headers for all of requests
Code:
Header add Content-Description "File Transfer"
#Header add Content-Type        "video/x-ms-wmv"
Header add Content-Disposition "attachment"
 
Last edited:
Top