CppCMS

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
cppcms::http::multipart_filter Class Reference

`#include <cppcms/http_content_filter.h>`

Inheritance diagram for cppcms::http::multipart_filter:

## Public Member Functions
virtual void | on_new_file (http::file &input_file)
virtual void | on_upload_progress (http::file &input_file)
virtual void | on_data_ready (http::file &input_file)
Public Member Functions inherited from cppcms::http::basic_content_filter
virtual void | on_end_of_content ()
virtual void | on_error ()

## Detailed Description

Filter for multipart/form-data - file upload

It allows to process/validate incomping data on the fly and make sure that for example the user is actually authorized to upload such a files

New in CppCMS 1.2

## Member Function Documentation

virtual void cppcms::http::multipart_filter::on_data_ready | ( | http::file & | input_file | ) |
| virtual

The entire file data was transfered, its size wouldn't change

Notes:

- This is the point when you can save file if needed or perform final validation
- The request can be aborted by throwing abort_upload
- By default does nothing

virtual void cppcms::http::multipart_filter::on_new_file | ( | http::file & | input_file | ) |
| virtual

New file meta-data of a form field or file is ready: the mime-type, form name and file name if provided are known, the content wasn't processed yet

Notes:

- This is the point when you can change various file properties, like location of the temporary file or specifiy output file name and more
- The request can be aborted by throwing abort_upload
- By default does nothing

virtual void cppcms::http::multipart_filter::on_upload_progress | ( | http::file & | input_file | ) |
| virtual

Some of the file data is available, you can access it and run some validation during upload progress.

Notes:

- This is the point when you can perform some file content validation
- The request can be aborted by throwing abort_upload
- By default does nothing

The documentation for this class was generated from the following file:

- cppcms/http_content_filter.h