File upload element

Function : Allows the user to attach a file to the form

Parameters

Label The label of this element
CSS Class CSS class assigned to this element
Style using CSS only Defines whether or not JForms should append inline CSS attributes to the element, Set to “YES” if you want to disable inline CSS attributes
Required Whether or not this field is required , the Form will not be submitted until this field is filled
Maximum Size(MB) Maximum allowed file size in Megabytes (decimal values like “0.5”, “0.1' are accepted)
Extensions Allowed extensions comma separated (File extensions are case insensitive)

Notes:

  • php,php3,php4,ph3,ph4 extensions are not allowed even if the user specifies them in the “Extensions” field, this behavior can be changed by modifying the <param name=“veryBadExtensions”> tag in the file “path/to/joomla/administrator/components/com_jforms/plugins/elements/file/parameters.xml”
  • Files are stored on the file system under ”/path/to/joomla/media/com_jforms/files/dbTableName/dbFieldName/dbRecordId/Filename.ext”
  • The data stored in the database are base64 encoded class containing
    • file path relative to ”/path/to/joomla/media/com_jforms/files/”
    • file name
    • file url
    • file size

Examples

To create a required file upload field that allows only pdf and odf files whose sizes are below 2.5 MB

  • Set “Required” = “Yes”
  • Set “Maximum Size(MB)” = “2.5”
  • Set “Extensions” = “pdf,odf”
 
0.7/elements/file.txt · Last modified: 2009/09/06 18:59 by dr_drsh
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki