Versions Compared

Key

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

Table of Contents

Todo

  • uitleggen waarom configuratie nodig?
  • + voorbeeld

Goal

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

...

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 the functionality of Follow the steps below to model a multiple file upload the following steps have to be taken:

  1. Define a connection name as described before.

  2. Create an entity, e.g. 'File', in your model.
  3. Create at least one attribute: File.Id. For convenience add also . This attribute is needed to store the id of the file, and without this attribute this functionality does not work. When handling files it is often practical to use a few other attributes such as File.Name, File.Type and File.Size. Create these attributes too.
  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 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.

...