简体   繁体   English

p-fileupload无法处理大量文件

[英]p-fileupload doesn't work with lots of files

We use 我们用

    <p-fileUpload name="myfile[]" url="{{url}}" multiple="multiple"
                  (onBeforeSend)="onBeforeSend($event)" (onError)="onError($event)" 
                  accept=".xml" maxFileSize="50000000">
    </p-fileUpload>

This works fine in most cases. 在大多数情况下,这可以正常工作。 But I have a use case where the user uploads 784 files with a total size of 1.02GB and a highest file size of 39MB. 但是我有一个用例,用户上载了784个文件,总大小为1.02GB,最大文件大小为39MB。

The files are not sent and OnError is called. 不发送文件,并调用OnError But in the OnError no reason why it fails is provided: 但是在OnError没有提供失败的原因:

private onError(event) {
    console.log("FileUpload.OnError:");
    console.log(event);
}

event.xhr.readyState is 4, event.xhr.response is empty. event.xhr.readyState为4,event.xhr.response为空。

When I upload the same files in smaller amounts it is working fine. 当我上传较少数量的相同文件时,它工作正常。 So it seems the files are not the problem but the amount or the total size. 因此看来文件不是问题,而是数量或总大小。 But I'm not sure and I have no idea how to solve this. 但是我不确定,我也不知道如何解决这个问题。

This seems to be an error with your backend maximum request size. 您的后端最大请求大小似乎是错误的。

Try to increase the maximum request size. 尝试增加最大请求大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM