Class t.w.s.FileSaver(resource.PostableResource):

Part of twisted.web2.static View Source View In Hierarchy

Undocumented
Line # Kind Name Docs
429 Method __init__ Undocumented
436 Method makeUniqueName Called when a unique filename is needed.
447 Method isSafeToWrite Returns True if it's "safe" to write this file,
462 Method writeFile Does the I/O dirty work after it calls isWriteable to make
478 Method render Subclasses should implement this method to do page rendering.

Inherited from PostableResource:

Line # Kind Name Docs
209 Method http_POST Respond to a POST request.

Inherited from Resource (via PostableResource):

Line # Kind Name Docs
148 Method locateChild Locates a child resource of this resource.
173 Method child_ This method locates a child with a trailing "/" in the URL.
182 Method putChild Register a static child.
197 Method http_GET Undocumented

Inherited from RenderMixin (via PostableResource, Resource):

Line # Kind Name Docs
19 Method allowedMethods
27 Method checkPreconditions Checks all preconditions imposed by this resource upon a request made
53 Method renderHTTP See iweb.IResource.renderHTTP.
89 Method http_OPTIONS Respond to a OPTIONS request.
99 Method http_TRACE Respond to a TRACE request.
107 Method http_HEAD Respond to a HEAD request.
def __init__(self, destination, expectedFields=, allowedTypes=None, maxBytes=1000000, permissions=420):
Undocumented
def makeUniqueName(self, filename):

Called when a unique filename is needed.

filename is the name of the file as given by the client.

Returns the fully qualified path of the file to create. The file must not yet exist.
def isSafeToWrite(self, filename, mimetype, filestream):
Returns True if it's "safe" to write this file, otherwise it raises an exception.
def writeFile(self, filename, mimetype, fileobject):
Does the I/O dirty work after it calls isWriteable to make sure it's safe to write this file.
def render(self, req):
Subclasses should implement this method to do page rendering. See http_GET.
Parametersrequestthe request to process.
Returnsan object adaptable to iweb.IResponse.