style

Plug-in Attributes

Learn about the attributes exposed in Page Designer.
 

Storage

Attribute NameAttribute TypeDescriptionOptionsExamples
Storage TypeSelect List

Choose where the uploaded files are saved.

APEX Collection

The APEX collection way should be the easiest. You only have to enter a Collection Name. Data will be saved as following:

Column c001 => filename
Column c002 => mime_type
Column d001 => date created
Column n001 => random file id
Column blob001 => BLOB of file

The Default Collection name is DROPZONE_UPLOAD.

Custom Table

When using custom table, beside table name, the following column name could be used:

  • Primary Key
  • Foreign Key
  • Filename
  • Mime Type
  • File Content (BLOB)
  • Date

Please note that the Primary Key (PK) must be processed with a Before Insert Trigger or similar.

Web service

The plug-in allows you to upload directly to an external webservice.

  • APEX Collection
  • Custom Table
  • Web Service

    APEX Collection

    Select query to select from the collection:
    SELECT c001    AS filename,
           c002    AS mime_type,
           d001    AS date_created,
           n001    AS file_id,
           blob001 AS file_content
      FROM apex_collections
     WHERE collection_name = 'DROPZONE_UPLOAD';
    
    Collection / Table NameTextUsed to define the APEX Collection name or Custom Table name.--
    Filename ColumnTextColumn of your custom Table which holds the information for the Filename. Only if Storage Type is set to Custom Table--
    Mime Type ColumnTextColumn of your custom Table which holds the information for the File Mime-Type. Only if Storage Type is set to Custom Table--
    BLOB ColumnTextColumn of your custom Table which holds the information for the File Content (BLOB). Only if Storage Type is set to Custom Table--
    Date ColumnTextColumn of your custom Table which holds the information for the File Upload Date. Only if Storage Type is set to Custom Table--
    PK ColumnTextPrimary Key (PK) Column of your custom file Table. The Primary Key (PK) must be processed with a Before Insert Trigger.--
    FK ColumnTextColumn of your custom Table which holds the information for the foreign key. Only if Storage Type is set to Custom Table--
    FK ItemPage ItemFK Item holding the FK value. Items will be read from the session state. It has to be submitted before upload.--
    Web Service parametersTextareaSpecify the parameters for the Web Service call using JSON file.-{"url":"https://www.apexrnd.be/ords181/ape/upload/image","method":"POST"}
     

    Behaviour

    Attribute NameAttribute TypeDescriptionOptionsExamples
    max. Filesize in MBNumberMaximum File Size (Float Number) that is allowed per file. If a file is larger, it will be removed.-1
    2
    3.5
    max. FilesNumberMaximum number of allowed files that can be uploaded at once.--
    Accepted File TypesText

    This option allows you to define a list of accepted file types. A Comma separated list of Mime-Types (with Wildcard support) or File endings: image/*,application/pdf,.psd is required.

    By default all file types are allowed.

    -image/*,application/pdf,.psd
    Upload MechanismSelect List

    Normal: Files are directly uploaded to the DB using a multipart/form-data POST (FormData) request. This method needs no conversion (decode, encode) of strings, thus the final BLOB is already there and can be used.

    Chunked: Files are split into chunks (default: 1MB), then each chunk is encoded into base64. This encoded string is then uploaded to the DB, the DB decodes the encoded chunks and builds a final BLOB out of it.

    Both methods should work with all web server combinations. Thus no conversion is needed for "normal" uploads, this method is 2x as fast as "chunked". If, somehow, your web server configuration allows no large multipart/form-data requests, go with the "chunked" method.

    • Normal
    • Chunked
      -
      ClickableSelect ListIf true, the Dropzone Region will be clickable. If false, nothing will be clickable and only Drag & Drop is possible.
      • True
      • False
        -
        Copy & Paste SupportSelect ListAdds support for Copy & Paste of Images in modern Browsers (like Chrome or Firefox > 50).
        • True
        • False
          1) Open Image File
          2) Copy File (Strg+C or Cmd+C)
          3) Paste it to the page which contains the Dropzone Region in your Browser (Strg+V or Cmd+V)
          Remove Files after UploadSelect ListIf true, clears all Files from Dropzone Region after uploading has finished.
          • True
          • False
            -
            Delete FilesSelect ListPossibility for end users to delete each file that was uploaded to the server.
            Only if no Page Refresh has occurred.
            • True
            • False
              -
               

              Look & Feel

              Attribute NameAttribute TypeDescriptionOptionsExamples
              Dropzone StyleSelect List

              UI Style of your Dropzone Region

              • Grey Border
              • Blue Dashed Border
              • Red Dashed Border
              • Grey Dashed Border/Background
              • Grey Border
              • Blue Dashed Border
              • Red Dashed Border
              • Grey Dashed Border/Background
                -
                WidthTextEnter the default width of your Dropzone Region. Valid values are px and % data.-700px
                100%
                HeightTextEnter the default height of Dropzone Region. Valid values in px.-400px
                500px
                Show File PreviewsSelect ListShow Preview Images for common File types when adding files.
                Images got displayed with real content.
                If you want to add more images or others just Copy/Upload the PNG Files to "img" directory. Naming: .png
                • True
                • False
                  -
                   

                  Transformation

                  Attribute NameAttribute TypeDescriptionOptionsExamples
                  WatermarkTextarea

                  In order to watermark images prior upload, a JSON configuration string has to be defined in this field.

                  The following attributes are accepted:

                  • font: specifies the current text style to use when drawing text. This string uses the same syntax as the CSS font specifier.
                  • fontColor: specifies the color, gradient, or pattern to use inside shapes. The default style is #000 (black).
                  • positionX: x-axis coordinate of the point at which to begin drawing the text, in pixels.
                  • positionY: y-axis coordinate of the point at which to begin drawing the text, in pixels.
                  • text: string to be embedded
                  -{"font": "22px Arial", "fontColor": "#3b8a50aa", "positionX": 5, "positionY": 10, "text": "Dropzone Enhance"}
                  Rename Function (JavaScript)Textarea

                  In order to rename your files prior upload, a user defined function can be defined in this field. This function gets the file as argument and can use the file.name.

                  The actual name of the file that gets used during the upload can be accessed through file.upload.filename.

                  When converting files to JPEG, a rename function is needed to change name extension.

                  -

                  Renaming function with extension change example

                  function (file) { 
                      let newName = new Date().getTime() + '_' + file.name.substr(0, file.name.lastIndexOf('.'))+'.jpeg';
                      return newName; 
                  }
                  
                  Transformation parametersTextarea

                  In order to transform images prior to upload, a JSON configuration string has to be set.

                  The plug-in supports image resizing keeping aspect ratio, image cropping and image conversion and compression.

                  • Resize keeping aspect ratio: setting at least one resize attribute (resizeWidth or resizeHeight), will lead to image resizing keeping aspect ratio
                  • Resize cropping: setting both resize attributes (resizeWidth and resizeHeight) will lead to image cropping to desire size
                  • Convert and compress: setting resizeMimeType to "image/jpeg" and resizeQuality to a decimal between 0 and 1, will lead to image conversion to JPEG and compression to desired rate. Renaming function is required if the source image is not in JPEG format. See renaming function for that.
                  • Restore EXIF: setting this parameter will reattach previus EXIF settings if needed (jpgm, jpeg)
                  -{"resizeWidth":"300", "resizeMimeType": "image/jpeg", "resizeQuality":"0.8", "restoreEXIF": "true"}