### Function

# Soup form_decode_multipart

#### Declaration [src]

    GHashTable*
    soup_form_decode_multipart (
      SoupMultipart* multipart,
      const char* file_control_name,
      char** filename,
      char** content_type,
      GBytes** file
    )

#### Description [src]

Decodes the “multipart/form-data” request in `multipart`.

this is a convenience method for the case when you have a single file upload control in a form. (Or when you don’t have any file upload controls, but are still using “multipart/form-data” anyway.) Pass the name of the file upload control in `file_control_name`, and `soup_form_decode_multipart()` will extract the uploaded file data into `filename`, `content_type`, and `file`. All of the other form control data will be returned (as strings, as with `soup_form_decode()` in the returned `GHashTable`.

You may pass `NULL` for `filename`, `content_type` and/or `file` if you do not care about those fields. `soup_form_decode_multipart()` may also return `NULL` in those fields if the client did not provide that information. You must free the returned filename and content-type with `g_free()`, and the returned file data with Glib.Bytes.unref.

If you have a form with more than one file upload control, you will need to decode it manually, using `soup_multipart_new_from_message()` and `soup_multipart_get_part()`.

#### Parameters

`multipart` | `SoupMultipart`
| A `SoupMultipart`.
| The data is owned by the caller of the function.
`file_control_name` | `const char*`
| The name of the HTML file upload control.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`filename` | `char**`
| Return location for the name of the uploaded file.
| The argument will be set by the function.
| The argument can be `NULL`.
| The called function takes ownership of the data, and is responsible for freeing it.
| The value is a NUL terminated UTF-8 string.
`content_type` | `char**`
| Return location for the MIME type of the uploaded file.
| The argument will be set by the function.
| The argument can be `NULL`.
| The called function takes ownership of the data, and is responsible for freeing it.
| The value is a NUL terminated UTF-8 string.
`file` | `GBytes`
| Return location for the uploaded file data.
| The argument will be set by the function.
| The argument can be `NULL`.
| The called function takes ownership of the data, and is responsible for freeing it.

#### Return value

Returns: | `GHashTable`
| a hash table containing the name/value pairs (other than `file_control_name`) from `msg`, which you can free with `g_hash_table_destroy()`. On error, it will return `NULL`.
| The caller of the function takes ownership of the data container, but not the data inside it.
| The return value can be `NULL`.