class FilePartStore

Library: Net
Package: Messages
Header: Poco/Net/PartStore.h


An implementation of PartSource for persisting parts (usually email attachment files) to the file system.


Direct Base Classes: PartStore

All Base Classes: PartSource, PartStore

Member Summary

Member Functions: filename, path, stream

Inherited Functions: filename, getContentLength, headers, mediaType, stream



    const std::string & content,
    const std::string & mediaType,
    const std::string & filename = ""

Creates the FilePartStore for the given MIME type. For security purposes, attachment filename is NOT used to save file to the file system. A unique temporary file name is used to persist the file. The given filename parameter is the message part (attachment) filename (see filename()) only.

Throws an exception if the file cannot be opened.


~FilePartStore virtual


Destroys the FilePartStore.

Member Functions

filename virtual

const std::string & filename() const;

Returns the filename portion of the path. This is the name under which the file is known to the user of this class (typically, MailMessage class). The real name of the file as saved to the filesystem can be obtained by calling path() member function.


const std::string & path() const;

Returns the full path to the file as saved to the file system. For security reasons, file is not saved under the real file name (as specified by the user).

stream virtual

std::istream & stream();

Returns a file input stream for the given file.