[dev] FileUpload Class

Vijay Mahrra vijay.mahrra at es.easynet.net
Mon Mar 24 17:22:59 PST 2003


Quoting Charles Hagenbuch <chuck at horde.org>:

: This is the right place to send things. Where would you suggest this be
: used? Have you looked at Horde_Form::, and the file upload capability that
: is already there?

Yes, the class Horde_Form_Type_file in Form.php has a function isValid() could 
at be modified to check some of the extra attributes from the validation 
function class I wrote.

Perhaps a new function in the Horde_Form_Type_file under the name of 
getValidUploads could incorporate these features, as at the moment isValid() 
only informs the user that a file was successfully uploaded, not the extra 
functionality a developer would probably need to check: specifically 
allowed/denied mime_types, the allowing of zero-byte file uploads, and error id.

The funcionality I wrote for where to store the validated uploaded files, 
whether or not to keep them after script execution could be useful but I'm not 
sure if storing in the Horde_Form_Type file class is the best place, perhaps 
it is something that should be application specfic.  Same with the optional 
automatic storage in VFS of validated files.

I would be happy to modify Horde_Form_Type_file if there is some agreement on 
the points I raised with regard to validation and the functions in my class.
Regardless I hope that the function I wrote perhaps could be of some use to 
someone on this list experimenting with file uploads in their modules.

Vijay




More information about the dev mailing list