I'm trying to send a file to a browser. The file type is a word doc. When the word doc downloads, and I try to open it, the text is all jumbled. This code works fine for pdf's and images by changing the Content-Type accordingly...
exit('File not found');
header('Content-Length: ' . filesize($fullpath));
header('Content-Disposition: attachment; filename="' . urldecode($path) . '"');
$file = fopen($fullpath, 'r');
print fread($file, filesize($fullpath));