cordova-plugin-file-transfer icon indicating copy to clipboard operation
cordova-plugin-file-transfer copied to clipboard

Request Timeout on Big File (180MB)

Open allidoisace opened this issue 3 years ago • 2 comments

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

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

allidoisace avatar Oct 27 '21 00:10 allidoisace

Hello! Have you found a solution to the problem?

MarchenkoOleg avatar Nov 07 '22 09:11 MarchenkoOleg

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

Vansinnesvisor avatar Nov 09 '22 03:11 Vansinnesvisor