http headers - Send file content with Php (net::ERR_CONTENT_LENGTH_MISMATCH) -


i know how can send mpeg file content client browser.

i have code:

<?php header("content-type: audio/mpeg"); header("content-length: ".filesize("13662f12.mp3")); header("cache-control: no-cache"); readfile("13662f12.mp3"); 

on local works fine. on server file stops reading after 10 seconds. downloaded song ctrl+s , play player without problem.

i have error: net::err_content_length_mismatch on chrome.

i tried on firefox nothing.

i know why too!

your code correct. issue related server settings. maybe there's execution time limit set on server. disable set_time_limit(0); (if it's allowed).

also, try figure out causes issue. try send smaller files , check if sent correctly. inspect headers server sends.


Comments