You are here

function ResourceUpload::save in D7 Media 6

Save the current state of a drupal_file in the database. If the file->fid is empty a new database record will be added.

Return value

bool TRUE if save succeeded, FALSE if save failed.

Overrides Resource::save

1 call to ResourceUpload::save()
ResourceUpload::move in resource/resource.module
Move a Resource.

File

resource/resource.module, line 335
Resource API for Drupal, a replacement for files.

Class

ResourceUpload

Code

function save() {

  // validate if not already validated, error is validation didn't pass.
  if (!$this
    ->validate()) {
    return FALSE;
  }

  // rename the file to its original name.
  parent::save();
}