apache / apache/cordova-plugin-file-transfer

onprogress does not work on iOS when uploading file.

Open
#234 2 comments 0 reactions 0 assignees View on GitHub
platform: ios
Dominant language
JavaScript
Stars
606
Forks
874
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
onprogress does not work on iOS when uploading file.Android success.
### What is expected to happen?

onprogress return data when uploading file.

### What does actually happen?

onprogress does not work when uploading file.

## Information

### Command or Code

import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';

@Injectable()
export class UploadService {

fileTransfer: FileTransferObject;

constructor(
private transfer: FileTransfer,
private config: Config,
private user: User
) {
this.fileTransfer = this.transfer.create();
}

// 执行文件上传
this.fileTransfer.upload(file.filePath, this.config.host + '/appProduct/document/upload' , options, false).then(
result => {
console.log('result');
}
).catch(
error => {
console.error(error);
}
);

this.fileTransfer.onProgress((progressEvent) => {
console.log('----progressEvent----',progressEvent)
});

}
### Environment, Platform, Device

"cordova-plugin-file": "^4.3.3",
"cordova-plugin-file-transfer": "^1.6.3",
"ionic-angular": "^3.9.5",
"cordova-ios": "^4.4.0",

on iOS.

### Version information

{
"name": "wzlApp",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/animations": "5.0.0",
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@angular/platform-server": "5.0.0",
"@ionic-native/android-fingerprint-auth": "^4.20.0",
"@ionic-native/app-version": "3.12.1",
"@ionic-native/call-number": "3.12.1",
"@ionic-native/camera": "^4.0.0",
"@ionic-native/clipboard": "^4.3.2",
"@ionic-native/core": "^4.3.1",
"@ionic-native/device": "^4.20.0",
"@ionic-native/file": "^3.12.1",
"@ionic-native/file-transfer": "^4.20.0",
"@ionic-native/geolocation": "^4.20.0",
"@ionic-native/http": "^4.5.3",
"@ionic-native/image-picker": "^4.0.0",
"@ionic-native/in-app-browser": "^4.4.2",
"@ionic-native/keyboard": "^3.14.0",
"@ionic-native/media": "^4.20.0",
"@ionic-native/network": "^4.20.0",
"@ionic-native/photo-library": "^4.20.0",
"@ionic-native/qqsdk": "^4.20.0",
"@ionic-native/qr-scanner": "^4.20.0",
"@ionic-native/splash-screen": "3.12.1",
"@ionic-native/status-bar": "^4.5.3",
"@ionic-native/touch-id": "^4.20.0",
"@ionic-native/transfer": "^3.12.1",
"@ionic-native/zbar": "^4.3.2",
"@ionic/storage": "2.1.3",
"angular-svg-round-progressbar": "^1.1.0",
"call-number": "^1.0.1",
"com.synconset.imagepicker": "https://github.com/Telerik-Verified-Plugins/ImagePicker.git",
"cordova-android": "^6.2.3",
"cordova-android-support-gradle-release": "^3.0.0",
"cordova-browser": "^4.1.0",
"cordova-hot-code-push-plugin": "^1.5.3",
"cordova-ios": "^4.4.0",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-compat": "^1.1.0",
"cordova-plugin-console": "~1.0.5",
"cordova-plugin-crosswalk-webview": "^2.3.0",
"cordova-plugin-cszbar": "^1.3.4",
"cordova-plugin-device": "~1.1.4",
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-file-transfer": "^1.6.3",
"cordova-plugin-http": "^1.2.0",
"cordova-plugin-inappbrowser": "^1.7.2",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-network-information": "^1.3.3",
"cordova-plugin-splashscreen": "~4.0.1",
"cordova-plugin-statusbar": "^2.4.1",
"cordova-plugin-telerik-imagepicker": "git+https://github.com/Telerik-Verified-Plugins/ImagePicker.git",
"cordova-plugin-whitelist": "~1.3.1",
"cordova-sqlite-storage": "^2.0.4",
"ionic-angular": "^3.9.5",
"ionic-image-loader": "^3.2.1",
"ionic-plugin-keyboard": "~2.2.1",
"ionicons": "3.0.0",
"mx.ferreyra.callnumber": "~0.0.2",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.0",
"cordova": "^6.5.0",
"cordova-sqlite-storage-dependencies": "^1.0.3",
"http-proxy-middleware": "^0.17.3",
"typescript": "2.4.2"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "myApp: An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-crosswalk-webview": {
"XWALK_VERSION": "23+",
"XWALK_LITEVERSION": "xwalk_core_library_canary:17+",
"XWALK_COMMANDLINE": "--disable-pull-to-refresh-effect",
"XWALK_MODE": "embedded",
"XWALK_MULTIPLEAPK": "true"
},
"phonegap-plugin-push": {},
"mx.ferreyra.callnumber": {},
"cordova-plugin-file": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": " ",
"PHOTOLIBRARY_USAGE_DESCRIPTION": " "
},
"com.synconset.imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "为了能够使您正常上传文件"
},
"cordova-sqlite-storage": {},
"cordova-clipboard": {},
"cordova-plugin-network-information": {},
"cordova-plugin-cszbar": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-http": {},
"cordova-hot-code-push-plugin": {},
"PALink": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-ionic-webview": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.0.0"
}
},
"platforms": [
"android",
"browser",
"ios"
]
}
}

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

Contributor guide

Open the contributing guide

Research direction

Reproduce the supplied FileTransfer upload and onProgress example on iOS using the listed Cordova plugin versions, then compare its behavior with Android. Trace the plugin's iOS progress-reporting path; done means upload progress events are delivered on iOS as they are on Android.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.