You can deal with files using tables connected to Appframe File Store. File links are manually
data-attr. A upload context (which sets up drag and drop area) is set
data-upload="uploadContextName". A dedicated upload can be set up using
By default, it will add drop hover text to upload container. To change text, use
data-hide-backdrop="true" to hide hover text.
uploadContextName.setCurrentPrimKey(PrimKey) to set or change current file PrimKey. Usefull for example if you need to update file, instead of inserting new one.
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:
removeFile(pFile)- will mark file as deleted in upload list.
save(pCallback)- will process files to server and will return callback if it is specified.
files()- will return all files added to the uploader. Note: it will also return removed files, which will have deleted flag.
getFilesCount()- will return files count. It will not count removed files.
appendFiles(true) in manual upload mode for all files to be appended to upload list. Otherwise new files will replace existing list. Default is false.
Useful when you want to create list of files with several drags or selects.
To register event use
onFilesUploaded- will fire after files are uploaded to the server.
paramwill return uplaoded files.
onBeforeUpload- will fire before sending files to the server. Useful to add additional fields for file store, by using
onManualUpload- will fire after files are added to upload list.
paramwill return last added files.
onError- will fire on error.
paramwill return error message.
onCancel- will fire if upload has been cancelled by the user.