The EAFlashUpload allows to add a some additional text data to an upload request. Because of each file are sent to the server via separate request this additional data was named the customFileProperties. They have the following structure:
- public - the properties available for editing via user interface(see customColumns of TableView GUI). Additional flag edit indicates whether properties can be changed.
- private - internal properties
There are a number of ways how custom file properties can be defined:
-
via XML full mode:
<EAFlashUpload> <customFileProperties> <public> <description value="Photo album files" edit="true"/> </public> <private> <folderToSave value="UploadedFiles" /> <anotherProp value="somevalue" /> </private> </customFileProperties> </EAFlashUpload>
-
via XML short mode:
<EAFlashUpload> <customFileProperties> <public value="description:Photo album files" /> <private value="folderToSave:UploadedFiles|anotherProp:somevalue" /> </customFileProperties> </EAFlashUpload>
different properties are delimited with "|" vertical line symbol. -
via flashvars object of SWFObject object:flashvars["customFileProperties.public"] = "description:Photo album files"; flashvars["customFileProperties.private"] = "folderToSave:UploadedFiles|anotherProp:somevalue"; -
via EAFlashUpload JavaScript API:
function setCustomProp() { var propertyObj = new Object(); propertyObj.name = "description"; propertyObj.value = "Photo album files"; propertyObj.isPublic = true; // uncomment below code if you need to define property for specific file // propertyObj.fileId = "an unique identifier of the file"; EAFlashUpload.setCustomProperty(propertyObj); propertyObj = new Object(); propertyObj.name = "folderToSave"; propertyObj.value = "UploadedFiles"; propertyObj.isPublic = false; EAFlashUpload.setCustomProperty(propertyObj); propertyObj = new Object(); propertyObj.name = "anotherProp"; propertyObj.value = "somevalue"; propertyObj.isPublic = false; EAFlashUpload.setCustomProperty(propertyObj); }