Kentico CMS 6.0 Developer's Guide

Using the File field

Using the File field

Previous topic Next topic Mail us feedback on this topic!  

Using the File field

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

In the overview, we mentioned the File field used in the previous versions. Use of this field is still possible and could be particularly useful if you want to have a field where only one file can be uploaded. The default CMS.File document type is based on the use of this type of field.

 

If you want to define a new File field, choose File from the Attribute type drop-down list when defining a new field.

 

devguide_clip0778

 

As you can see in the screenshot above, the Form control drop-down list can be used to choose between two available controls for file uploading which will be displayed on the Form tab:

 

Upload file

 

This is the original control which was used in the previous versions.

 

devguide_clip0827

 

Direct uploader

 

This is the same control that is used for uploading attachments via the Form tab. The only difference is that it allows only one file to be uploaded.

 

This is how it looks like when no file is uploaded:

 

devguide_clip0828

 

And here is the control after file upload:

 

devguide_clip0786