apache / cordova-plugin-file-transfer

Apache Cordova File Transfer Plugin
https://cordova.apache.org/
Apache License 2.0
598 stars 885 forks source link

Request Timeout on Big File (180MB) #321

Open allidoisace opened 2 years ago

allidoisace commented 2 years ago

Bug Report

Problem

[BackgroundTask] Background Task 1 ("Called by CordovaPlugins, from -[CDVFileTransfer uploadData:command:]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

NSURLConnection finished with error - code -1001
File Transfer Error: The request timed out.

What is expected to happen?

Not timeout.

What does actually happen?

Times out.

Information

Using latest master branch code.

Command or Code

Ensure file is large. If the timeout doesn't occur, increase file size. The current environment is in a K8's cluster, so there may be some overhead there on my end.

const fileURL = file:// ...
const options: FileUploadOptions = {
      fileKey: 'file',
      fileName: fileURL.substring(fileURL.lastIndexOf('/') + 1),
      mimeType: 'text/plain',
    };

    // TODO Pass created uuid and version
    const params: any = {};
    params.value1 = 'test';
    params.value2 = 'param';

    options.params = params;

    const ft = new FileTransferObject();
    ft.upload(
      fileURL,
      encodeURI(`http://example.com`),
      options,
    );

Environment, Platform, Device

K8's/Docker with iOS, iPad Pro 12.9

Version information

cordova-plugin-file: 6.0.2 cordova-plugin-file-transfer: github:apache/cordova-plugin-file-transfer#master Capacitor: 3.2.4 Ionic: 5.8.4 Ionic CLI: 6.17.1 XCode: 13

Checklist

MarchenkoOleg commented 1 year ago

Hello! Have you found a solution to the problem?

Vansinnesvisor commented 1 year ago

When I upload large files on iOS I get a similar error. Works well on Android. Any solution yet?