function file_field_widget_uri

cis7 file.field.inc file_field_widget_uri($field, $instance, $data = array())
cle7 file.field.inc file_field_widget_uri($field, $instance, $data = array())
elmsmedia7 file.field.inc file_field_widget_uri($field, $instance, $data = array())
icor7 file.field.inc file_field_widget_uri($field, $instance, $data = array())
meedjum_blog7 file.field.inc file_field_widget_uri($field, $instance, $data = array())
mooc7 file.field.inc file_field_widget_uri($field, $instance, $data = array())

Determines the URI for a file field instance.

Parameters

$field: A field array.

$instance: A field instance array.

$data: An array of token objects to pass to token_replace().

Return value

A file directory URI with tokens replaced.

See also

token_replace()

3 calls to file_field_widget_uri()
file_feeds_set_target in sites/all/modules/ulmus/feeds/mappers/file.inc
Callback for mapping. Here is where the actual mapping happens.
file_field_widget_form in modules/file/file.field.inc
Implements hook_field_widget_form().
multiupload_filefield_widget_field_widget_form in sites/all/modules/ulmus/multiupload_filefield_widget/multiupload_filefield_widget.field.inc
Implements hook_field_widget_form().

File

modules/file/file.field.inc, line 577
Field module functionality for the File module.

Code

function file_field_widget_uri($field, $instance, $data = array()) {
  $destination = trim($instance['settings']['file_directory'], '/');

  // Replace tokens.
  $destination = token_replace($destination, $data);

  return $field['settings']['uri_scheme'] . '://' . $destination;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.