Citat:
Predrag Supurovic:
Code:
<?php
if (is_user_logged_in()) {
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="document.pdf"');
readfile('../privatestorage/document.pdf');
} else {
echo "You must be logged in to view this page.";
}
?>
ako je kod mene fajl word dokument .docx da li bi trebalo da ovaj kod izgleda ovako:
Code:
<?php
if (is_user_logged_in()) {
header('Content-type: application/docx');
header('Content-Disposition: attachment; filename="mojdokument.docx"');
readfile('dokumenti/mojdokument.docx');
} else {
echo "You must be logged in to view this page.";
}
?>
Da li trebam ovo spasiti kao zaseban dokument recimo "dokumenti.php" ili se ovaj kod moze zaljepiti na page gdje se nalazi dokument?
Opet nece, ne znam.