File upload

You can deal with files using tables connected to Appframe File Store. File links are manually created using data-attr. A upload context (which sets up drag and drop area) is set using data-upload="uploadContextName". A dedicated upload can be set up using data-upload-target="uploadContextName".

or drag and drop from your computer

Aditional options

By default, it will add drop hover text to upload container. To change text, use data-upload-hovertext="Custom text". Use data-hide-backdrop="true" to hide hover text.

uploadContextName can be used in javascript to extend file upload.

Use uploadContextName.setCurrentPrimKey(PrimKey) to set or change current file PrimKey. Usefull for example if you need to update file, instead of inserting new one.

Use uploadContextName.manulaUpload(true) to enable manual upload mode. In this mode, files are not processed directly to server, instead they are stored in file upload object. There are several methods available:

  • appendFiles(pFilesList) - will add files list to upload list.
  • removeFile(pFile) - will remove file from upload list.
  • save(pCallback) - will process files to server and will return callback if it is specified.

To register event use uploadContextName.attachEvent("onFilesUploaded",function(param){...}) in javascript file. These methods are available:

  • onFilesUploaded - will fire after files are uploaded to the server. param will return uplaoded files.
  • onBeforeUpload - will fire before sending files to the server. Useful to add additional fields for file store, by using param.append("field",value).
  • onManualUpload - will fire after files are uploaded to the server on manual upload mode. There are no param available.
  • onError - will fire on error. param will return error message.