The following code is often used to read or download any file. This code is available everywhere but I don't find any explanation how each line of this code works.
header('Content-Description: File Transfer');header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$file_name.'"');header('Expires: 0');header('Cache-Control: must-revalidate');header('Pragma: public');header('Content-Length: ' . filesize($file_link.$file_name));header("Content-Type: ".$file_mime);
It will be really grateful if anyone can explain working of each line of above code. I'm also curious to know any security risk involved in above code. Thank you.