-1
if(isset($_GET['rf'])){
$filename=$_GET['rf'];
//$path=$_SERVER['DOCUMENT_ROOT'].'/'.$filename;
//echo $path;
if(file_exists("subs/" . $filename)){
header('Content-Type: text/plain');
//header('Content-Disposition: attachment; filename='.$filename); <-- DOWNLOAD FILE
header('Content-Length: ' . filesize("subs/" . $filename));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
ob_clean();
flush();
readfile(utf8_encode("subs/" . $filename));
}
}
- Appears without accents when reading the file
It seems to me that I have yet to define the
chatset
in theheader
that defines theContent-Type
. Which means it may not be visualized asutf-8
though it has been read asutf-8
– Isac
I recommend reading: https://answall.com/questions/29455/comorconverter-caracteres-em-utf-8-no-php/29470#29470
– José