|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-04-19 10:39 UTC] nbari at mac dot com
Description:
------------
a leading slash must be used on the mime_tye to get Content-
Type to work:
header("Content-Type: audio/x-ms-wma"); do not work
header("Content-Type: /audio/x-ms-wma"); it works
Reproduce code:
---------------
<?php
header("Content-Type: audio/x-ms-wma");
header("Content-Disposition: filename=\"file.wma\"");
readfile("/Volumes/RamDisk/file.wma");
?>
if audio/x-ms-wma is replaced with /audio/x-ms-wma so it looks like :
header("Content-Type: /audio/x-ms-wma");
the code works.
with out the leading / the code do not work.
Expected result:
----------------
the windows media player to open the wma file or the option
for saving the file.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 22:00:02 2025 UTC |
making some tests, notice that the code works on php 4 but the problem only seems to happend on php 5.1.2. i used the following code for testing: <?php $file = 'file.wma'; $tono = 'tono.wma'; $content_length = filesize($file); header("Content-Type: audio/x-ms-wma"); header('Content-Length: '.$content_length); header('Content-Disposition: filename="'.$tono.'"'); readfile($file); ?>