Now,we are going to talk about the xml file that defines our control , this xml defines the dll that will be loaded when we create an instance of our control , which means when we create a new column with our field type , and also this xml file defines all the additional options we want the user to set when creating this new column , such as additional lists or document libraries needed to continue our control logic.
In our control we need to define some external fields to be set by the user and they are :
1. The Images Document library Text box at which the Multiple attachment control will upload its file in, it will be entered by the user.
2. The Videos and Pdfs document libraries text boxes to define them also.
3. For each List we will also want to define the maximum number of uploads we want the user to enter at each item, so we need to define 3 number fields will be managed by the users also , for ex; if he set the max number of image uploads to 3 , after that he wont be able to upload any other image file to the document library he had set.
The following is the Xml file we have used to define the previous fields and the control we will add.
<?xml version="1.0" encoding="utf-8" ?>
<FieldTypes>
// defining the File Uploader Control
// The TypeName is the name of the Class representing the file uploder.
// The ParentType will be Text which means that we will react with the control as Text field (SpFieldText).
<FieldType>
<Field Name="TypeName">FileUploader</Field>
<Field Name="ParentType">Text</Field>
<Field Name="TypeDisplayName">Multiple File Uploader</Field>
<Field Name="TypeShortDescription">Multiple File Uploader</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="FieldTypeClass">SpCustomFields.FileUploader,SpCustomFields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1a277eba047c831e</Field>
<PropertySchema>
<Fields>
<Field Name="ImagesList"
DisplayName="Images List Name"
Required="TRUE"
MaxLength="30"
DisplaySize="30"
Type="Text">
<Default></Default>
</Field>
<Field Name="ImagesMaximumLength"
DisplayName="No. of Image files"
Required="TRUE"

Join the conversation! Your thoughts help the community grow.