### Method

# Gtk FileDialog save

unstable since: 4.10

#### Declaration [src]

    void
    gtk_file_dialog_save (
      GtkFileDialog* self,
      GtkWindow* parent,
      GFile* current_file,
      const char* current_name,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description [src]

This function initiates a file save operation by presenting a file chooser dialog to the user.

You should pass either `current_file` if you have a file to save to, or `current_name`, if you are creating a new file.

If you pass `current_file`, the file chooser will initially be opened in the parent directory of that file, otherwise, it will be in the directory `GtkFileDialog:current-folder`.

The `callback` will be called when the dialog is dismissed. It should call `gtk_file_dialog_save_finish()` to obtain the result.

Available since: 4.10

#### Parameters

`parent`

  Type: `GtkWindow`

  The parent `GtkWindow`

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`current_file`

  Type: `GFile`

  The initial file.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`current_name`

  Type: `const char*`

  The initial filename to offer.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  A `GCancellable` to cancel the operation.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`callback`

  Type: `GAsyncReadyCallback`

  A callback to call when the operation is complete.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  Data to pass to `callback`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.