apache / cordova-plugin-file-transfer

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

Server issue: Cordova flie-transfer-plugin working on UAT server but not on Production server #336

Open CherukuriSiva opened 2 years ago

CherukuriSiva commented 2 years ago

Issue Type

Description

Information

We have Cordova-based iOS and android apps that are running on production and UAT for the last year.

By using these apps users can uploads images, audio, and videos to a server. The same applications working fine for the last year but for the last few days production server is not receiving the attachments. But all other API calls to the same production server working fine. While testing the file upload from the android app on the production server... createAttachment API request has not even reached the production server. But the same application working fine on the UAT server. On the mobile app side, everything same but only the endpoint URL is different. This project is a very old project and we have not updated this app for a long time.

Command or Code

  var reactThis =this;
  var options = new FileUploadOptions();
  options.fileKey = "file";
  options.chunkedMode = false;
  options.fileName = "5.jpg";

  options.mimeType = "text/plain";
  options.headers = { headerParam: 'headerValue', Connection: 'close' };
  var params = {};
  params.fileType = fileType;
  options.params = params;

  console.log("*uploading "+fileType+" filename "+options.fileName);

  var ft = new FileTransfer();

  ft.onprogress = function (progressEvent) {
  };//end ft on progress function
  var uri = encodeURI(app.serverurl + "createAttachment");
  var win = (response) => {

  });

  var fail = (error) => {

    });
  }

  ft.upload(fileURL, uri, win, fail, options,true);

Environment, Platform, Device

android iOS

Version information

$ node -v
v8.12.0
$ cordova -v
7.1.0
$ monaca -v
2.4.1
$ npm -v
6.4.1

$ gradle --version
------------------------------------------------------------
Gradle 4.1
------------------------------------------------------------

Checklist