file_unmanaged_move

  1. drupal
    1. drupal7
Versionen
drupal7 file_unmanaged_move($source, $destination = NULL, $replace = FILE_EXISTS_RENAME)

Move a file to a new location without calling any hooks or making any changes to the database.

see file_move()

Übergabeparameter

$source A string specifying the file location of the original file.

$destination A string containing the destination that $source should be moved to. This can be a complete file path, a directory name or, if this value is omitted, Drupal's 'files' directory will be used.

$replace Replace behavior when the destination file already exists:

Rückgabewert

The filepath of the moved file, or FALSE in the event of an error.

Verwandte Themen

▾ 5 functions call file_unmanaged_move()

FileUnmanagedMoveTest::testMissing in modules/simpletest/tests/file.test
Try to move a missing file.
FileUnmanagedMoveTest::testNormal in modules/simpletest/tests/file.test
Move a normal file.
FileUnmanagedMoveTest::testOverwriteSelf in modules/simpletest/tests/file.test
Try to move a file onto itself.
file_move in includes/file.inc
Move a file to a new location and update the file's database entry.
file_unmanaged_save_data in includes/file.inc
Save a string to the specified destination without calling any hooks or making any changes to the database.

Code

includes/file.inc, line 620

<?php
function file_unmanaged_move($source, $destination = NULL, $replace = FILE_EXISTS_RENAME) {
  $filepath = file_unmanaged_copy($source, $destination, $replace);
  if ($filepath == FALSE || file_unmanaged_delete($source) == FALSE) {
    return FALSE;
  }
  return $filepath;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen