Wt: Wt::Http::UploadedFile Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::Http::UploadedFile Class Reference
HTTP protocol (Wt::Http)

Details about a file uploaded with a request to a resource. More...

`#include <Wt/Http/Request.h>`

## Public Member Functions
const std::string & | spoolFileName () const
| Return the spool file name.
const std::string & | clientFileName () const
| Returns the client file name.
const std::string & | contentType () const
| Returns the file content type.
void | stealSpoolFile () const
| Steals the uploaded spool file.

## Detailed Description

Details about a file uploaded with a request to a resource.

See also
  Request::uploadedFiles()
  WResource::handleRequest()

## Member Function Documentation

## ◆ clientFileName()

const std::string & Wt::Http::UploadedFile::clientFileName | ( |  | ) | const

Returns the client file name.

This is the location that was indicated by the browser.

Note
  Depending on the browser this is an absolute path or only the file name.

## ◆ contentType()

const std::string & Wt::Http::UploadedFile::contentType | ( |  | ) | const

Returns the file content type.

Returns the content mime-type that was sent along with the uploaded file.

## ◆ spoolFileName()

const std::string & Wt::Http::UploadedFile::spoolFileName | ( |  | ) | const

Return the spool file name.

This is the location on the local (server) filesystem where the uploaded file is temporarily stored. Unless you call stealSpoolFile(), this file is deleted automatically.

## ◆ stealSpoolFile()

void Wt::Http::UploadedFile::stealSpoolFile | ( |  | ) | const

Steals the uploaded spool file.

By stealing the spooled file, it is no longer automatically deleted by Wt.