I tried this:
$temp = tmpfile();
file_put_contents($temp,file_get_contents("$path/$filename"));
But I get this error: "Warning: file_put_contents() expects parameter 1 to be string,"
If I try:
echo file_get_contents("$path/$filename");
It return to screen the file content as a long string. Where am I wrong?