Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This how-to describes how to use the multiple file upload.

Info
Note that

...

Internet Explorer 9 (IE9) is not able to handle multiple files, only single files.

...

In IE 10+, Firefox and Chrome multiple files works properly.

For this the functionality of multiple files you do not need to install any pluginplug in.

Configuration

Please configure the connection in the aquima.properties file in the home folder first. Currently there are two connection flavors:

  • Memory

    Code Block
    connection.<connection name>.memory
  • File system

    Code Block
    connection.<connection name>.filesystem.path=<your path>

    Replace <your path> with the correct path. Note to use '/' in your path, e.g. C:/Files/.

Also check that your language properties file (e.g. messages_en-GB) contains the following lines:

Code Block
#fileupload
fileupload.label.single=Add file...
fileupload.label.multi=Add files...
fileupload.description.filesize=Maximum file size is: {0}
fileupload.description.extension=Allowed file extensions are: {0}
fileupload.validation.extension=File type not allowed
fileupload.validation.filesize=File is too large
fileupload.status.succes=File(s) uploaded successfully
fileupload.status.failed=Upload failed because the following file(s) do not meet all conditions:

...

Multiple File Upload

To build this the functionality of multiple file upload the following steps have to be taken.:

  1. Define a connection name as described earlierbefore.

  2. Create an entity, e.g. 'File', in your model.
  3. Create at least one attribute: File.Id. For convenience add also File.Name, File.Type and File.Size.
  4. Create an exposed flow.
  5. Create a page which is put in the flow and is connected.
  6. Create a container of type AQ_File_Upload ( and put place it on the page ) with the following parameters:

    ParameterValueComments
    Connection<connection name> 
    PersistenceTemporary 
    ModeMultiple files 
    FileIDFile.Id 
    FileNameFile.Name 
    FileTypeFile.Type 
    FileSizeFile.Size 
  7. Create a container of type AQ_InstanceSelectorPlus.
    1. Let the containment be: File.Id, File.Name, File.Type, File.Size, all of them read-only
    2. Let the parameters be: Parameter 'entity' should be 'File'.
  8. Let the instance selector container be the second container on the page.
  9. The upload container is ready to use.

...

It is possible to extend this list with some custom meta data fields. These can be created and updated by using the AQ_File_UpdateMetaData service.

Download File

To get the download file container work, first create a text item with the name 'DownloadText' and enter some text, e.g. Download.

Create a AQ_File_Download container and add the following parameters:

...

To be able to delete a file you need a service for that. Create a new service of type 'AQ_File_Delete'. Enter the following parameters:

...

ParameterValue
Connection<connection name>
FileIdFile.Id
FileNameFile.Name
FileTypeFile.Type
FileSizeFile.Size

Move a File

By using the AQ_File_Move it is possible to move a file from one connection to another connection. This could be handy useful when uploading on default to memory by default, adding some meta data and storing it on the file system afterwards. This service can be used by entering the following parameters.

...

There could be a need for directly triggering a flow when uploading a file. This could be handy useful when calling some services for setting information.

...

  • Add an event, e.g. 'AutomaticUpload'.
  • Add this event to the expected events of the AQ_File_Upload in the tab 'Events'.
  • Connect a service in the flow which is connected to this event.

Everytime Every time a new file is uploaded, this exit event will be taken.

...

See the file upload example project. 

UI Expand
titleRelated articles

Content by Label
showLabelsfalse
max5
spacesBKB
sortmodified
showSpacefalse
reversetrue
typepage
labelsfile_handling