A post_save signal handler which sends a signal for each ``FileField`` that
    was committed this save.
13206
def signal_committed_filefields(sender, instance, **kwargs):
    
    for field_name in getattr(instance, '_uncommitted_filefields', ()):
        fieldfile = getattr(instance, field_name)
        # Don't send the signal for deleted files.
        if fieldfile:
            signals.saved_file.send_robust(sender=sender, fieldfile=fieldfile)
1144094
async def message_field(self, msg, field, fvalue=None):
        
        fname, ftype, params = field[0], field[1], field[2:]
        try:
            self.tracker.push_field(fname)
            if self.writing:
                await self._dump_message_field(self.iobj, msg, field, fvalue=fvalue)
            else:
                await self._load_message_field(self.iobj, msg, field)
            self.tracker.pop()

        except Exception as e:
            raise helpers.ArchiveException(e, tracker=self.tracker) from e
1168924
def flush(self):
        

        if self.kind == TraceField:
            self.filehandle.putth(self.traceno, self.buf)

        elif self.kind == BinField:
            self.filehandle.putbin(self.buf)

        else:
            msg = 'Object corrupted: kind {} not valid'
            raise RuntimeError(msg.format(self.kind))
317053
def on_save(self, event):
        ''''''
        dlg = wx.FileDialog(None, self.settings.get_title(), '', "", '*.*',
                            wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
        if dlg.ShowModal() == wx.ID_OK:
            self.settings.save(dlg.GetPath())
512317
def post_save(self):
        """"""
        if self.run:
            self.run = False
            self.create_tasks()
            self.save()
321318
def save(self, *args, **kwargs):
        
        super(Layer, self).save(*args, **kwargs)

        # if is_published of an existing layer changes
        if self.pk and self.is_published != self._current_is_published:
            # send django signal
            layer_is_published_changed.send(
                sender=self.__class__,
                instance=self,
                old_is_published=self._current_is_published,
                new_is_published=self.is_published
            )
            # unpublish nodes
            self.update_nodes_published()

        # update _current_is_published
        self._current_is_published = self.is_published
772472
protected function submitEditFile()
    {
        if ($this->isPosted('delete') && isset($this->data_file['file_id'])) {
            $this->deleteFile();
        } else if ($this->isPosted('save') && $this->validateEditFile()) {
            if (isset($this->data_file['file_id'])) {
                $this->updateFile();
            } else {
                $this->addFile();
            }
        }
    }
356472
def find_uncommitted_filefields(sender, instance, **kwargs):
    
    uncommitted = instance._uncommitted_filefields = []

    fields = sender._meta.fields
    if kwargs.get('update_fields', None):
        update_fields = set(kwargs['update_fields'])
        fields = update_fields.intersection(fields)
    for field in fields:
        if isinstance(field, FileField):
            fieldfile = getattr(instance, field.name)
            if fieldfile and not fieldfile._committed:
                uncommitted.append(field.name)
1229856
def save(self, filename, callback=_noop_callback):
        
        with open(filename, 'wb') as fp:
            self._save(fp, callback)
645987
def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save"):
        
        self.reply_saver = Saver(self.reply_handlers, filename, delay)
1263126
def setup_signals(self, ):
        
        self.browser.shot_taskfile_sel_changed.connect(self.shot_taskfile_sel_changed)
        self.browser.asset_taskfile_sel_changed.connect(self.asset_taskfile_sel_changed)

        self.shot_open_pb.clicked.connect(self.shot_open_callback)
        self.asset_open_pb.clicked.connect(self.asset_open_callback)
        self.shot_save_pb.clicked.connect(self.shot_save_callback)
        self.asset_save_pb.clicked.connect(self.asset_save_callback)
1203618
function handlePost(req, res) {
  var length = parseInt(req.headers['content-length'], 10);
  if (length <= 0) {
    res.end();
    return;
  }

  var filename = req.headers['x-filename'] || 'save-trace.wtf-trace';
  var writable = fs.createWriteStream(filename, {flags: 'w'});

  req.on('data', function(chunk) {
    writable.write(chunk);
  });

  req.on('end', function() {
    console.log(filename);
    writable.end();
    res.end();
  });
}
305444
def _save_sign(self, filepath):
        """"""

        if self.code_array.safe_mode:
            msg = _("File saved but not signed because it is unapproved.")
            try:
                post_command_event(self.main_window, self.StatusBarMsg,
                                   text=msg)
            except TypeError:
                # The main window does not exist any more
                pass

        else:
            try:
                self.sign_file(filepath)

            except ValueError, err:
                msg = "Signing file failed. " + unicode(err)
                post_command_event(self.main_window, self.StatusBarMsg,
                                   text=msg)
683359
def handle_job_and_work_save(self, sender, instance, **kwargs):
    
    self.handle_save(instance.project.__class__, instance.project)
718103
protected function __save()
    {
        $this->parseDate();
        foreach($this->records as $record)
        {
            FileUtil::writeFile($this->getFileName(), $this->getLogString($record) . PHP_EOL, FILE_APPEND);
        }
    }
768948
public function sendResponse()
    {
        if (!function_exists('ob_list_handlers') || ob_list_handlers()) {
            @ob_end_clean();
        }
        header("Content-Encoding: none");

        $this->checkConnector();
        $this->checkRequest();

        if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
        }

        $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["FileName"]);
        $_resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();

        if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        if (!$_resourceTypeInfo->checkExtension($fileName, false)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
        }

        $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
        if ($_resourceTypeInfo->checkIsHiddenFile($fileName) || !file_exists($filePath) || !is_file($filePath)) {
            $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
        }

        $fileName = CKFinder_Connector_Utils_FileSystem::convertToConnectorEncoding($fileName);

        header("Cache-Control: cache, must-revalidate");
        header("Pragma: public");
        header("Expires: 0");
        if (!empty($_GET['format']) && $_GET['format'] == 'text') {
            header("Content-Type: text/plain; charset=utf-8");
        }
        else {
            $user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
            $encodedName = str_replace("\"", "\\\"", $fileName);
            if (strpos($user_agent, "MSIE") !== false) {
                $encodedName = str_replace(array("+", "%2E"), array(" ", "."), urlencode($encodedName));
            }
            header("Content-type: application/octet-stream; name=\"" . $fileName . "\"");
            header("Content-Disposition: attachment; filename=\"" . $encodedName. "\"");
        }
        header("Content-Length: " . filesize($filePath));
        CKFinder_Connector_Utils_FileSystem::sendFile($filePath);
        exit;
    }
563489
public function route_save_handlers() {

		// Bail -- our fields aren't being edited
		// Otherwise we'll do an unnecessary nonce check
		if ( empty( $_POST['network_edit'] ) ) {
			return;
		}
		
		$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );
		if ( empty( $action ) ) {
			$alternative_actions = array( 'delete', 'delete_multiple', 'move' );
			foreach ( $alternative_actions as $alternative_action ) {
				if ( filter_input( INPUT_POST, $alternative_action ) ) {
					$action = $alternative_action;
					break;
				}
			}
		}

		switch ( $action ) {

			// Create network.
			case 'create':
				$this->check_nonce();
				$this->handle_add_network();
				break;

			// Update network.
			case 'update':
				$this->check_nonce();
				$this->handle_reassign_sites();
				$this->handle_update_network();
				break;

			// Delete network.
			case 'delete':
				$this->check_nonce();
				$this->handle_delete_network();
				break;

			// Delete multiple networks.
			case 'delete_multiple':
				$this->check_nonce();
				$this->handle_delete_networks();
				break;

			// Move site to different network.
			case 'move':
				$this->check_nonce();
				$this->handle_move_site();
				break;
		}
	}