function _update_object_operation() { if ($file = $this->dataspace->get('file')) { $object_data =& fetch_requested_object(); $this->object->set_attribute('media_id', $object_data['media_id']); $this->object->set_attribute('tmp_file_path', $file['tmp_name']); $this->object->set_attribute('file_name', $file['name']); $this->object->set_attribute('mime_type', $file['type']); } return parent::_update_object_operation(); }
function _update_object_operation(&$object) { if (isset($_FILES[$this->name]['tmp_name']['file'])) { if ($_FILES[$this->name]['size']['file'] > ini_get('upload_max_filesize') * 1024 * 1024) { message_box::write_warning('uploaded file size exceeds limit'); return false; } $object_data =& fetch_mapped_by_url(); $object->set_attribute('media_id', $object_data['media_id']); $object->set_attribute('tmp_file_path', $_FILES[$this->name]['tmp_name']['file']); $object->set_attribute('file_name', $_FILES[$this->name]['name']['file']); $object->set_attribute('mime_type', $_FILES[$this->name]['type']['file']); } return parent::_update_object_operation(&$object); }