i'm trying to allow clients to download pdf's using the header() function. i can get it to work with the plain/text mime type, but not pdf's.
header("Content-type: application/pdf");
header("Content-disposition: attachment; filename=$file");
header("Content-length: $size");
readfile ($file);
lets me download the file name, but not its content. file length is always zero. i've tried adding "AddType application/pdf .pdf" to httpd.conf, but still no luck.
i'm sure this is a simple issue. but can anyone help me out?