Package WebStack :: Package Helpers :: Module Request :: Class FileContent
[show private | hide private]
[frames | no frames]

Class FileContent


A simple class representing uploaded file content. This is useful in holding
metadata as well as being an indicator of such content in environments such
as Jython where it is not trivial to differentiate between plain strings and
Unicode in a fashion also applicable to CPython.

Instances of this class contain the following attributes:

  * stream  - a stream object through which the content of an uploaded file
              may be accessed
  * content - a plain string containing the contents of the uploaded file
  * headers - a dictionary containing the headers associated with the
              uploaded file

Method Summary
  __init__(self, stream, headers)
Initialise the object with a 'stream' through which the file can be read, along with optional 'headers' describing the content.
  __getattr__(self, name)
Provides a property value when 'name' is specified as "content".
  __str__(self)
  reset(self)
Reset the stream providing the data, returning whether this succeeded.

Method Details

__init__(self, stream, headers=None)
(Constructor)

Initialise the object with a 'stream' through which the file can be
read, along with optional 'headers' describing the content.

__getattr__(self, name)
(Qualification operator)

Provides a property value when 'name' is specified as "content".

reset(self)

Reset the stream providing the data, returning whether this succeeded.

Generated by Epydoc 2.1 on Mon Oct 29 00:09:23 2007 http://epydoc.sf.net