下载后查看文件时出现问题

I created a code to download some PDF file and it works perfectly thru local host but when I uploaded it to the free web host the downloading works fine but when I opened it it says "Error Failed to load PDF document." Can Anyone tell me what's wrong? and how to fix my problem? link: https://chezanda.000webhostapp.com/metrocombined/

This is the some part of my code from download.php

$file = 'media/'.$data['filename'];

if(file_exists($file)){
    header('Content-Description: '. $data['description']);
    header('Content-Type: '.$data['type']);
header('Content-Disposition: '.$data['disposition'].'; filename="'.basename($file).'"');
    header('Expires: '.$data['expires']);
    header('Cache-Control: '.data['cache']);
    header('Pragma: '.$data['pragma']);
    header('Content-Length: '.filesize($file));
    readfile($file);
    exit;

and sample data from my database

newfiles (id, filename, type, description, disposition, expires, cache, pragma) VALUES (1, '02-04b 03a TRAINING CHECKLIST IL.pdf', 'application/octet-stream', 'File Transfer', 'attachment', '0', 'must-revalidate', 'public')