Friendly URL in Drupal to a PDF that is buried deep in a module?
I have a PDF burried in a module (sites/all/modules/mymodule/开发者_如何学运维pdf/userguide.pdf)....how do i make it a friendly url like (sitename.com/mymodule/userguide.pdf) ?
or in your module code next:
/**
* Implementation of hook_menu()
*/
function mymodule_menu() {
$items['mymodule'] = array(
'page callback' => 'mymodule_pdf',
'type' => MENU_CALLBACK,
'access arguments' => array('access content'),
'page arguments' => array(1),
);
...
return $items;
}
function mymodule_pdf ($filename) {
// function that will upload generated $filename.pdf
}
p.s. Also you can try add alias via path module, map: sites/all/modules/mymodule/pdf/userguide.pdf to mymodule/userguide.pdf...
精彩评论