How to add current user field to view field list, when it has no relation to the content? Is it possible to add the current user-id in the rewrite results of a View Field ?

I have created a view of fields of a custom content type "Document". My goal is to rewrite the Document: Title-field to a hyperlink of the following format: 

http://mysite.com/download.php?u=[user-id]&amp;docid=[document-fid]

where user-id is the id of the currently logged-in user, and [document-fid] is the id of the file in the records of the view.

I know full well that before you can use a certain field in a rewrite, it needs to be added to the fields list of the view, and it has to be placed before the field you want  rewritten. But here is the problem. When I click "add" in the fields list, I don't see a User, or a User: Current-field.

Please bare in mind that User: Current has absolutely NO relation to the author of the item, or any other user related to the document. Therefor I cannot use the Relationships, under the Advanced section in views.

Please advise.
This is an answer for Drupal 7.

You can 


use Views template system and rewrite output of the field (will work only for Views) or 
create own formatter for file field (will work everywhere for fields with this formatter) or
alter any file path in hook_file_url_alter (will work everywhere without settings)


I will show how to create field formatter. It will correctly work with standard node rendering, Views, Panels, etc.  

/**
 * Implements hook_field_formatter_info().
 */
function YOURMODULE_field_formatter_info() {
  return array(
    // Our own formatter for 'file' field
    'YOURMODULE_file_link' =&gt; array(
      'label' =&gt; t('Special download link'),
      'field types' =&gt; array('file'),
    ),
  );
}

/**
 * Implements hook_field_formatter_view().
 */
function YOURMODULE_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  global $user;
  // Now just hide field if user not logged in
  if (user_is_anonymous()) {
    return;
  }

  switch ($display['type']) {
    case 'YOURMODULE_file_link':
      foreach ($items as $delta =&gt; $item) {
        // Some title
        $title = isset($item['description']) ? $item['description'] : $item['filename'];
        // Theme link (http://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_link/7)
        $element[$delta] = array(
          '#theme' =&gt; 'link',
          '#text' =&gt; $title,
          '#path' =&gt; 'download.php',
          '#options' =&gt; array(
                        'attributes' =&gt; array(),
                        'html' =&gt; FALSE,
                        'query' =&gt; array('u' =&gt; $user-&gt;uid, 'document-fid' =&gt; $item['fid'])
                      )
        );

      }
      break;

  }
  return $element;
}


Add this code to your module (replace YOURMODULE with your module name), enable module, clear the cache if needed. New formatter will be available in Views field settings and in standard content type display settings.