php - How to download mp4 file via http headers -
i've got mp4 file saved on external ftp server. when save on "save video as" when play video in classic html5 player, ok. when download file on headers:
header('content-description: file download'); header('content-transfer-encoding: binary'); header('content-length: file_size'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: no-cache'); header('expires: mon, 1 apr 1974 05:00:00 gmt'); header("content-type: video/mp4"); header("content-disposition: attachment; filename=file_name"); readfile(file_url); // double-download-dance (dirty worky) (file_size, file_url , file_name filled correctly of course), mp4 file downloaded, every player "this format not supported". when download other filetype (pdf/ppt,...), ok.
any ideas, pls??
file 1 (wrong file, not able play):
http://www.vaseakademie.cz/ajax/s:lekcetools/c:lekcetools/m:getfile/loid:177
through 'stáhnout lekci'
filesize: 50156182 md5:ef0bf2fdfe1774c0a75d26202cdebdcd
file 2 (correct file, able play):
http://data.vaseakademie.cz/lekce/kurz_68/b55bf87383652751aeefd02f844f9fd9.mp4
from source if playing video. same right click, save video as
filesize: 50156182 md5:ef72631add8524d72ac1b61bacf0cc1a
conclusion:
nothing wrong header, file content different. should check script file processing, not header
Comments
Post a Comment