I am offering a preaching download site and I have a user facing a problem with its download Have any idea how I can improve this code, or maybe send a better header ...
$ path = "http://www.domain.com / Sermon_files / ".date" Y ", $ array [" Promoted "]). "/". $ Array ["filename"]; $ CorePath = "/home/user/public_html/sermon_files/".date("Y", $ array ["Promoted"]). "/". $ Array ["filename"]; If (! File_exists ($ corePath)) echo "An error has occurred with this download."; } And {header ("PAGMA: public"); // Required header ("End: 0"); Header ("Cash-Control: Required-Modified, Post Check = 0, Pre-Check = 0"); Header ("Cash-Control: Private", Incorrect); Header ("content-type: audio / mp3"); Header ("content-dispute: attachment; filename = \" $ array ["title"]. "\"; "); Header ("content-transfer-encoding: binary"); Header ("Content-Length:". Philips ($ Core Path)); Readfile ($ path); Go out(); }
Take a look at this thread, I have similar problems: Also consider using Fidler to capture the exact HTTP headers being sent.
No comments:
Post a Comment