I have implemented hook_file_download function in my module. When I call function current_path in the body of this hook, it returns path of the file, not path of current URL in browser. The similar result I got when I try method request_path or variable $_SERVER['REQUEST_URI'].
My hook_file_download is called after I am programatically displaying image with function
<?php
function some_page_callback() {
// $args = ...some args
$output = theme('image_style', $args);
return $output;
}
?>
How to get path registered in hook_menu for "some_page_callback" in hook_file_download method?
current_path()
wasn't the URL of the file, then the file must never have been requested, and that hook would never have fired. When you request a private file the current URL must be the file's URL, by definition. It sounds like you're looking to track the page that originally contained a link to your file. That's going to be almost impossible to do reliably.