matthew Wall created CB-11915:
---------------------------------

             Summary: cordova-plugin-file-transfer 1.6.0 error 1 file not found 
                 Key: CB-11915
                 URL: https://issues.apache.org/jira/browse/CB-11915
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin File Transfer
    Affects Versions: 3.5.0
         Environment: Android
            Reporter: matthew Wall


In an existing project I updated the file-transfer plugin to 1.6.0 and it now 
returns file not found.

Downgrading to 1.5.1 works as expected.

 var url = encodeURI(config.rtc.Upload);
                                        
                    var targetPath = $scope.imageSources[i].Photo;
                    // File name only
                    var filename = targetPath.split("/")
                        .pop();
                    photo_names.push(MemberID + "/" + filename);
                    var options = {
                        fileKey: "file",
                        fileName: filename,
                        chunkedMode: false,
                        mimeType: "image/jpg",
                        params: {
                            'directory': MemberID,
                            'fileName': filename
                        }
                    };
                    $scope.showError = function (error) {
                        var errorPopup = $ionicPopup.alert({
                            title: JSON.stringify(error),
                            template: '<p class="padding">Please try again 
later.</p>'
                        });
                        errorPopup.then(function (res) {
                            $scope.submitComplete();
                        });
                    };
                    $cordovaFileTransfer.upload(url, targetPath, options)
                        .then(function (result) {
                            //console.log("Response: " + 
JSON.stringify(result.response));
                            if (result.response == 'Upload error!') {
                                $scope.showError(result.response);
                            } else {
                                $scope.progressval = 0;
                                uploaded++;
                                $scope.sequential(uploaded);
                            }
                        }, function (err) {
                            console.log("ERROR: " + JSON.stringify(err));
                                $scope.showError('Upload error!');
                        }, function (progress) {
                            $scope.maxval = progress.total;
                            $scope.progressval = progress.loaded;
                        });



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to