Into

Modules

Documentation

classPiiHttpBodyPartHeader

#include <PiiHttpBodyPartHeader.h>

A class that stores header information for multipart messages as defined in RFC 1341, 2045, and 2387.

Inherits QHttpHeader

Description

PiiHttpBodyPartHeader eases parsing of such headers by providing some useful functions for querying values commonly used. Note that the default Content-Type for a multipart message is text/plain.

Constructors and destructor

Copy another header.

Copy another header.

Create an empty (invalid) header.

Parse a string containing header information.

Public member functions

Get the boundary string that separates entities in this multipart message.

Get the value of the Content-Disposition header, without parameters.

Get the name of the HTML form control that sent the following entity.

Get the name of an uploaded file, if the entity is a file uploaded from an HTML form.

bool

See if the header describes a multipart message.

bool

See if the header describes a file uploaded from a HTML form.

int
int

Copy another header.

Returns the "preamble" of a multipart message, if there is one.

void
( )

Set the preamble.

Function details

  • PiiHttpBodyPartHeader

    ( )

    Copy another header.

  • PiiHttpBodyPartHeader

    ( )

    Copy another header.

  • PiiHttpBodyPartHeader

    ()

    Create an empty (invalid) header.

  • PiiHttpBodyPartHeader

    ( )

    Parse a string containing header information.

    If the string is not correctly formatted, the header will become invalid.

  • ~PiiHttpBodyPartHeader

    ()
  • QString boundary

    ()

    Get the boundary string that separates entities in this multipart message.

    If this header does not represent a multipart message, an empty string will be returned.

  • QString contentDisposition

    ()

    Get the value of the Content-Disposition header, without parameters.

     // Content-Disposition: form-data; name=control
     QString disposition = header.contentDisposition(); // returns "form-data"
    
  • QString controlName

    ()

    Get the name of the HTML form control that sent the following entity.

    If the header does not contain such information, an empty string will be returned.

     // Content-Disposition: form-data; name=control
     QString name = header.controlName(); // returns "control"
    
  • QString fileName

    ()

    Get the name of an uploaded file, if the entity is a file uploaded from an HTML form.

    If there is no file name, an empty string will be returned.

  • bool isMultipart

    ()

    See if the header describes a multipart message.

    The Content-Type header field of a multipart message begins with multipart/. The body of a multipart message consists of many entities.

  • bool isUploadedFile

    ()

    See if the header describes a file uploaded from a HTML form.

    Browsers use multipart/form-data encoding to send files from HTML forms. If the Content-Disposition header contains a file name, the entity can be treated as an uploaded file. Use the fileName() function to get the name of the file.

  • int majorVersion

    ()
  • int minorVersion

    ()
  • PiiHttpBodyPartHeader & operator=

    ( )

    Copy another header.

  • QByteArray preamble

    ()

    Returns the "preamble" of a multipart message, if there is one.

    The preamble can be used to transfer additional information that is not part of the entity itself.

  • void setPreamble

    ( )

    Set the preamble.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.