I tested with Firefox, and uploading a form with an empty file input results in the following post contents:
-----------------------------135438447855682763402193870
Content-Disposition: form-data; name="foo"; filename=""
Content-Type: application/octet-stream
-----------------------------135438447855682763402193870--
Thus a zero-length field is uploaded. However no filename is set so test for the value of the filename
attribute instead.
If a field represents an uploaded file, accessing the value via the value attribute or the getvalue() method reads the entire file in memory as a string. This may not be what you want. You can test for an uploaded file by testing either the filename attribute or the file attribute.