DropzoneJS随机跳过文件发送到服务器 [英] DropzoneJS is randomly skipping files to send to the server

查看:60
本文介绍了DropzoneJS随机跳过文件发送到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 angular2-dropzone-wrapper 在Angular2应用程序中使用Dropzone。
我希望我的用户能够一次上传丢失的文件,但不能一次将所有文件发送到服务器。
我们曾经使用PrimeNG来实现,但是它们一次发送所有内容。

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.

我读到Dropzone会一一发送文件。我尝试了几种配置选项,但无法将所有选定的文件发送到服务器。他们中的大多数人都掉了,但我不知道为什么。我正在听几个事件,但是什么也没发送。

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.

我最好的配置是将5个文件一次发送到服务器,直到发送完所有文件。
我知道我需要 uploadMultiple parallelUploads 属性,但是我无法获取

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.

如果上传所有文件都需要花费一些时间,这不是问题,但是当似乎随机地跳过文件时,这是一个主要问题。
我不确定这是Dropzone还是Angular2包装器出现问题,但希望这里有人知道答案。

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.

这是我的HTML:

<dropzone [config]="dropZoneConfig" 
          (error)="onDropZoneUploadError($event)"
          (sendingmultiple)="onDropZoneSendingMultiple($event)"
          (queuecomplete)="onDropZoneQueueComplete($event)"
          (maxfilesreached)="onDropZoneMaxfilesReached($event)"
          (maxfilesexceeded)="onDropZoneMaxfilesExceeded"
          (totaluploadprogress)="onDropZoneTotalUploadProgress"></dropzone>

这是我的问题:

    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.

推荐答案

答案是不使用 autoRest ,而是在 DropzoneJS在上传后隐藏了dropzone区域,如何找回它?

The answer is to not use autoRest but instead use the answer at DropzoneJS hides dropzone area after uploading, how to get it back?

这篇关于DropzoneJS随机跳过文件发送到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆