5.2.2.16 type="..." attribute (file)

The tag determines the generated name (5.2.2.5) from the name related attributes.

If you are using an execution context that inherits from the NameRecorderMixin (7.4) then using this input field type will automatically cause the enclosing <al-form> (5.2.1) tag to include an enctype="multipart/form-data" (5.2.1.2) attribute.

For example:

>>> import albatross
>>> class Ctx(albatross.SimpleContext):
...     def input_add(self, *args):
...         print args
... 
>>> ctx = Ctx('.')
>>> albatross.Template(ctx, '<magic>', '''
... <al-input type="file" name="resume" whitespace>
... ''').to_html(ctx)
('file', 'resume', None, 0)
>>> ctx.flush_content()
<input type="file" name="resume">

After writing all tag attributes the execution context input_add() method is called with the arguments; input field type ('file'), the generated name, None, and a flag indicating whether or not the list (5.2.2.4) attribute was present.