[Form] Fixes empty file-inputs getting treated as extra field.
Re-applies 968fe23 (PR #8575)