#include <cgicc/FormFile.h>
Public Methods | |
Constructors and Destructor | |
FormFile () | |
Default constructor. More... | |
FormFile (const std::string &name, const std::string &filename, const std::string &dataType, const std::string &data) | |
Create a new FormFile. More... | |
FormFile (const FormFile &file) | |
Copy constructor. More... | |
~FormFile () | |
Destructor. More... | |
Overloaded Operators | |
bool | operator== (const FormFile &file) const |
Compare two FormFiles for equality. More... | |
bool | operator!= (const FormFile &file) const |
Compare two FormFiles for inequality. More... | |
FormFile & | operator= (const FormFile &file) |
Assign one FormFile to another. More... | |
Accessor Methods | |
Information on the uploaded file | |
void | writeToStream (std::ostream &out) const |
Write this file data to the specified stream. More... | |
std::string | getName () const |
Get the name of the form element. More... | |
std::string | getFilename () const |
Get the basename of the file on the remote machine. More... | |
std::string | getDataType () const |
Get the MIME type of the file data. More... | |
std::string | getData () const |
Get the file data. More... | |
std::string::size_type | getDataLength () const |
Get the length of the file data. More... |
FormFile is an immutable class reprenting a file uploaded via the HTTP file upload mechanism. If you are going to use file upload in your CGI application, remember to set the ENCTYPE of the form to multipart/form-data
.
<form method="post" action="http://change_this_path/cgi-bin/upload.cgi" enctype="multipart/form-data">
Definition at line 62 of file FormFile.h.
|
Default constructor.
Shouldn't be used. Definition at line 77 of file FormFile.h. |
|
Create a new FormFile.
This is usually not called directly, but by Cgicc.
|
|
Copy constructor.
Sets the name, filename, datatype, and data to those of
Definition at line 101 of file FormFile.h. |
|
Destructor.
Delete this FormFile object Definition at line 110 of file FormFile.h. |
|
Get the file data.
This returns the raw file data as a string
Definition at line 212 of file FormFile.h. |
|
Get the length of the file data.
The length of the file data is usually measured in bytes.
Definition at line 222 of file FormFile.h. |
|
Get the MIME type of the file data.
This will be of the form
Definition at line 202 of file FormFile.h. |
|
Get the basename of the file on the remote machine.
The filename is stripped of all leading directory information
Definition at line 192 of file FormFile.h. |
|
Get the name of the form element.
The name of the form element is specified in the HTML form that called the CGI application.
Definition at line 182 of file FormFile.h. |
|
Compare two FormFiles for inequality.
FormFiles are equal if they have the same filename.
Definition at line 137 of file FormFile.h. |
|
Assign one FormFile to another.
Sets the name, filename, datatype, and data to those of
|
|
Compare two FormFiles for equality.
FormFiles are equal if they have the same filename.
|
|
Write this file data to the specified stream.
This is useful for saving uploaded data to disk
|