Php readfile - Force İndir

0 Cevap php

Ben bazı mp3 dosyalarını oynatmak için bir flash player kullanıyorum. Firefox azından normalde onları yükler ama IE'de de öyle değil. I. Mp3 dosyasının url gittiğinizde (yerine indirmek için örneğin sunan) mp3 kaynak kodunu gösterir. Yani ben bunu düzeltmek için küçük bir script kullanılır:

$url = $_GET['url'];
header('Content-type: application/force-download');
header('Content-Transfer-Encoding: Binary');
header("Content-disposition: attachment; filename=demo.mp3");
readfile($url);

I would like to ask you if the above is safe. Moreover, does the server losses bandwidth by this way? And finally, does it influence the server's resources? Thanks.

0 Cevap