I'm using Dropzone in my Angular2 application using angular2-dropzone-wrapper
.
I want my users to be able to upload lost of files at once but not send all the files at once to the server.
We used to use PrimeNG for this but they send everything at once.
I read Dropzone would send the files one by one. I've tried several config options but I can't get all selected files to the server. Most of them are dropped but I don't know why. I'm listening to several events but nothing is send.
My preferable configuration would be that 5 files are send at once to the server until all files are send.
I understand I need the uploadMultiple
and parallelUploads
properties for this, but I can't get it to work.
If it takes some time to upload all files in not a problem but when seemingly randomly files are skipped this is a major problem. I'm not sure if this is a problem with Dropzone or the Angular2 wrapper but hopefully someone here knows the answer.
This is my HTML:
<dropzone [config]="dropZoneConfig"
(error)="onDropZoneUploadError($event)"
(sendingmultiple)="onDropZoneSendingMultiple($event)"
(queuecomplete)="onDropZoneQueueComplete($event)"
(maxfilesreached)="onDropZoneMaxfilesReached($event)"
(maxfilesexceeded)="onDropZoneMaxfilesExceeded"
(totaluploadprogress)="onDropZoneTotalUploadProgress"></dropzone>
This is my ts:
this.dropZoneConfig = {
server: this.url,
maxFilesize: 200, // MB
maxFiles: 500,
acceptedFiles: ".xml",
parallelUploads: 5,
uploadMultiple: true,
createImageThumbnails: false,
autoProcessQueue: true,
autoReset: 500,
addRemoveLinks: false,
headers: { "Authorization": "Bearer " + sessionStorage.getItem("AccessToken") }
};
Any help is much appreciated.
The answer is to not use
autoRest
but instead use the answer at DropzoneJS hides dropzone area after uploading, how to get it back?