FileUpload web component
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>
- example
-
lang
(optional, default:de
): set tode
oren
for German or English- example
<vpu-fileupload lang="de"></vpu-fileupload>
- example
-
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>
- example
-
deferred
(optional): if set files will not be uploaded immediately but only queued- use method
uploadFile
oruploadOneQueuedFile
to really upload the queued file - example
<vpu-fileupload deferred></vpu-fileupload>
- use method
-
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)
- example
-
disabled
(optional): disable input control- example
<vpu-fileupload disabled></vpu-fileupload>
- example
-
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
- example
-
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
- example
-
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
- example
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.