Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #37135 : header(Content-Type: mime_type) must have a leading before the mime_type
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 30th May 06:32
php-bugs
External User
 
Posts: 1
Default #37135 : header(Content-Type: mime_type) must have a leading before the mime_type


From: nbari at mac dot com
Operating system: Mac OS X version 10.4.6
PHP version: 5.1.2
PHP Bug Type: *General Issues
Bug description: header(Content-Type: mime_type) must have a leading before the mime_type

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.

--
Edit bug report at http://bugs.php.net/?id=37135&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37135&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37135&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37135&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37135&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37135&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37135&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37135&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37135&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37135&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37135&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37135&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37135&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37135&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37135&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37135&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37135&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37135&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37135&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37135&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37135&r=mysqlcfg
  Reply With Quote


  sponsored links


2 30th May 06:32
php-bugs
External User
 
Posts: 1
Default #37135 : header(Content-Type: mime_type) must have a leading before the mime_type


From: nbari at mac dot com
Operating system: Mac OS X version 10.4.6
PHP version: 5.1.2
PHP Bug Type: *General Issues
Bug description: header(Content-Type: mime_type) must have a leading before the mime_type

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.

--
Edit bug report at http://bugs.php.net/?id=37135&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37135&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37135&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37135&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37135&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37135&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37135&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37135&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37135&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37135&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37135&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37135&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37135&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37135&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37135&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37135&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37135&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37135&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37135&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37135&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37135&r=mysqlcfg
  Reply With Quote
3 30th May 06:32
External User
 
Posts: 1
Default #37135 : header(Content-Type: mime_type) must have a leading before the mime_type


ID: 37135
Updated by: tony2001@php.net
Reported By: nbari at mac dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Mac OS X version 10.4.6
PHP Version: 5.1.2
New Comment:

Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


Previous Comments:
------------------------------------------------------------------------

[2006-04-19 10:39:30] 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.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=37135&edit=1
  Reply With Quote
4 30th May 06:32
External User
 
Posts: 1
Default #37135 : header(Content-Type: mime_type) must have a leading before the mime_type


ID: 37135
Updated by: tony2001@php.net
Reported By: nbari at mac dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Mac OS X version 10.4.6
PHP Version: 5.1.2
New Comment:

Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


Previous Comments:
------------------------------------------------------------------------

[2006-04-19 10:39:30] 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.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=37135&edit=1
  Reply With Quote
5 30th May 09:55
php-bugs
External User
 
Posts: 1
Default #37135 : header(Content-Type: mime_type) must have a leading before the mime_type


ID: 37135
User updated by: nbari at mac dot com
Reported By: nbari at mac dot com
Status: Bogus
Bug Type: *General Issues
Operating System: Mac OS X version 10.4.6
PHP Version: 5.1.2
New Comment:

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);
?>


Previous Comments:
------------------------------------------------------------------------

[2006-04-19 10:43:36] tony2001@php.net

Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

------------------------------------------------------------------------

[2006-04-19 10:39:30] 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.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=37135&edit=1
  Reply With Quote
6 30th May 09:55
php-bugs
External User
 
Posts: 1
Default #37135 : header(Content-Type: mime_type) must have a leading before the mime_type


ID: 37135
User updated by: nbari at mac dot com
Reported By: nbari at mac dot com
Status: Bogus
Bug Type: *General Issues
Operating System: Mac OS X version 10.4.6
PHP Version: 5.1.2
New Comment:

Solution.

the problem was that for some reason the browser need the
extension of the file so i solve this using the following on
the virtual host:

RewriteRule ^/demo/(.+)/(.+)\.wma$ /demo.php?module=$1&id=$2
[L]

that way the url can be something like /demo/test/file.wma
and the file can be now download and played.


Previous Comments:
------------------------------------------------------------------------

[2006-04-19 22:56:35] nbari at mac dot com

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);
?>

------------------------------------------------------------------------

[2006-04-19 10:43:36] tony2001@php.net

Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

------------------------------------------------------------------------

[2006-04-19 10:39:30] 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.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=37135&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666