public function saveFile($file, $contentId) {
    // Prepare directory
    if (empty($contentId)) {
      // Should be in editor tmp folder
      $path = $this->getEditorPath();
    }
    else {
      // Should be in content folder
      $path = $this->path . '/content/' . $contentId;
    }
    $path .= '/' . $file->getType() . 's';
    self::dirReady($path);

    // Add filename to path
    $path .= '/' . $file->getName();

    copy($_FILES['file']['tmp_name'], $path);

    return $file;
  }
public function saveFile($file, $contentId) {
    // Prepare directory
    if (empty($contentId)) {
      // Should be in editor tmp folder
      $path = $this->getEditorPath();
    }
    else {
      // Should be in content folder
      $path = $this->path . '/content/' . $contentId;
    }
    $path .= '/' . $file->getType() . 's';
    self::dirReady($path);

    // Add filename to path
    $path .= '/' . $file->getName();

    copy($_FILES['file']['tmp_name'], $path);

    return $file;
  }
public function saveFile ( $ file , $ contentId ) { // Prepare directory if ( empty ( $ contentId ) ) { // Should be in editor tmp folder $ path = $ this -> getEditorPath ( ) ; } else { // Should be in content folder $ path = $ this -> path . '/content/' . $ contentId ; } $ path .= '/' . $ file -> getType ( ) . 's' ; self :: dirReady ( $ path ) ; // Add filename to path $ path .= '/' . $ file -> getName ( ) ; copy ( $ _FILES [ 'file' ] [ 'tmp_name' ] , $ path ) ; return $ file ; }
Save files uploaded through the editor.
The files must be marked as temporary until the content form is saved.

@param \H5peditorFile $file
@param int $contentid
Save files uploaded through the editor . The files must be marked as temporary until the content form is saved .