Skip to content
Snippets Groups Projects
Select Git revision
  • bf30b43954ac21c0f93d6df9544098c0dc2a61b2
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

file-handling

Christoph Reiter's avatar
Reiter, Christoph authored
From what I remember this got added in v12

Fixes #5
bf30b439
History

FileUpload web component

GitLab Repository

Files will be uploaded sequentially (not parallel) to prevent overburdening the destination server.

Usage

<vpu-fileupload></vpu-fileupload>

Attributes

  • url: path to the upload url
    • example <vpu-fileupload url="path/to/my/page"></vpu-fileupload>
  • lang (optional, default: de): set to de or en for German or English
    • example <vpu-fileupload lang="de"></vpu-fileupload>
  • always-send-file (optional): if set the uploaded or queued file will always be sent in the event
    • example <vpu-fileupload always-send-file></vpu-fileupload>
  • deferred (optional): if set files will not be uploaded immediately but only queued
    • use method uploadFile or uploadOneQueuedFile to really upload the queued file
    • example <vpu-fileupload deferred></vpu-fileupload>
  • allowed-mime-types (optional): if set accepts only files matching mime types
    • example <vpu-fileupload allowed-mime-types='application/pdf'></vpu-fileupload> ... PDFs only
    • example <vpu-fileupload allowed-mime-types='image/*'></vpu-fileupload> ... images (of all sub types) only
    • example <vpu-fileupload allowed-mime-types='image/png,text/plain'></vpu-fileupload> ... PNGs or TXTs only
    • example <vpu-fileupload allowed-mime-types='*/*'></vpu-fileupload> ... all file types (default)
  • disabled (optional): disable input control
    • example <vpu-fileupload disabled></vpu-fileupload>
  • decompress-zip (optional): decompress zip file and queue the contained files (including files in folders)
    • example <vpu-fileupload decompress-zip></vpu-fileupload>
    • mime types of allowed-mime-types will also be checked for the files in the zip file
  • nextcloud-auth-url (optional): Nextcloud Auth Url to use with the Nextcloud file picker
    • example <vpu-fileupload nextcloud-auth-url="http://localhost:8081/index.php/apps/webapppassword"></vpu-fileupload>
    • nextcloud-web-dav-url also needs to be set for the Nextcloud file picker to be active
  • nextcloud-web-dav-url (optional): Nextcloud WebDav Url to use with the Nextcloud file picker
    • example <vpu-fileupload nextcloud-web-dav-url="http://localhost:8081/remote.php/dav/files"></vpu-fileupload>
    • nextcloud-auth-url also needs to be set for the Nextcloud file picker to be active

Local development

# get the source
git clone git@gitlab.tugraz.at:VPU/WebComponents/FileUpload.git
cd FileUpload
git submodule update --init

# install dependencies (make sure you have npm version 4+ installed, so symlinks to the git submodules are created automatically)
npm install

# constantly build dist/bundle.js and run a local web-server on port 8002 
npm run watch-local

Jump to http://localhost:8002 and you should get a demo page.