Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 701

How this code to read file exactly works? [closed]

$
0
0

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.


Viewing all articles
Browse latest Browse all 701

Trending Articles