How to hide path location in drupal 7?
It can be done by implementing custom menu callback

/**
 * Implementation of hook_menu()
 */
 function mymodule_menu() {
   $items['media/view/%file'] = array(
     'page callback' =&gt; 'mymodule_download_file',
     'page arguments' =&gt; array(2),
     'access arguments' =&gt; array('access content'),
     'type' =&gt; MENU_CALLBACK,
   );
   return $items;
}

/**
 * Page callback for a file to download
 */
 function mymodule_download_file($file) {
   if($file) {
    file_transfer($file-&gt;uri, array('Content-disposition', 'attachment; filename='.$file-&gt;filename));
   }
   else {
    return drupal_access_denied();
   }
 }