maxlength in file input

Zsolt Rizsanyi rizsanyi at users.sourceforge.net
Tue Feb 7 18:24:05 GMT 2006


Hi!

I have to use an embedded web application that for some reason defines all 
its file input fields in forms as:
<INPUT TYPE="FILE" NAME="INI" SIZE="32" MAXLENGTH="32">

The given maxlength causes that most file paths I want to upload at 
truncated at 32, making it unusable.

I checked and Firefox and Internet Explorer do not enforce the maxlength 
attribute.

Then I have also checked the specification and found, that maxlength 
attribute should be only used by input fields of type text and password.

A comment in khtml/dom/html_form.h already says this:
Maximum number of characters for text fields, when \c type has the value 
"Text" or "Password". See the <a 
href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-maxlength"> 
maxlength attribute definition </a> in HTML 4.0.

I have made a patch to not enforce maxlength with file type inputs. It 
quite trivial, and I have attached it. I have tested it, and in fact I'm 
using it with my selfbuilt KDE 3.5 debian packages.

I was going to commit it, but then I changed my mind and decided to ask for 
blessing from one of the khtml developers :)
If you agree with my patch, then I will commit it and also backport it to 
3.5 branch.

Please CC me for the answers, since I'm not subscribed to this list.

Thanks,
Zsolt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_maxlength_for_file.patch
Type: text/x-diff
Size: 551 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060207/41a129f8/attachment.patch>


More information about the kfm-devel mailing list