You are here

function imagepicker_file_unmanaged_copy in Image Picker 7

4 calls to imagepicker_file_unmanaged_copy()
imagepicker_copy_form_submit in ./imagepicker.functions.inc
Function to submit the copy form
imagepicker_copy_uploaded_file in ./imagepicker.upload.inc
imagepicker_import_batch in ./imagepicker.import.inc
imagepicker_upload_form_submit in ./imagepicker.upload.inc
Submit form

File

./imagepicker.functions.inc, line 3054
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_file_unmanaged_copy($s, $d, $r = FILE_EXISTS_RENAME) {

  // file_unmanaged_copy does not check for trailing slashes
  $d = rtrim($d, DIRECTORY_SEPARATOR);
  $n = file_unmanaged_copy($s, $d, $r);
  if ($n) {

    // Fix bug in drupal's file_copy function which uses '/' instead of
    // DIRECTORY_SEPARATOR for making directories. This causes problems on
    // Windows machines. still true in D7
    $n2 = preg_replace("#^" . IMAGEPICKER_FILE_SCHEME . "#", '', $n);
    $n2 = str_replace('/', DIRECTORY_SEPARATOR, $n2);
    $n = IMAGEPICKER_FILE_SCHEME . $n2;
  }
  return $n;
}