You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/08 15:22:30 UTC

[GitHub] [cordova-plugin-file-transfer] obkdev opened a new issue #238: Camera Images fail to upload on iPhone

obkdev opened a new issue #238: Camera Images fail to upload on iPhone
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/238
 
 
   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   I'm able to successfully upload an image selected from library. I expect to capture an image and successfully upload an image from the camera in the same way as the library selection.
   
   ### What does actually happen?
   When I select camera and upload image from the camera I always get a 500 error. However, the image never makes it to my server so there isn't an error on the server side. 
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   `
   else if (this.platform.is('ios') && sourceType === this.camera.PictureSourceType.CAMERA) {
                   console.log('iPhone camera!');
   
                   var currentName = imagePath.substr(imagePath.lastIndexOf('/') + 1);
                   var correctPath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1);
                   let fileTransfer: FileTransfer = new FileTransfer()
                   let options: FileUploadOptions = {
                       fileKey: 'image',
                       fileName: currentName,
                       chunkedMode: false,
                       headers: {
                           "Application": "MyApp",
                           "Authorization": "Bearer " + localStorage.getItem(StorageKey.AccessToken)
                       }
                   }
                   fileTransfer.create().upload(normalizeURL(imagePath), encodeURI(this.uploadLink), options, true).then(result => {
                       console.log('File transfer result: ', result);
                   }).catch(err => {
                       console.log('Error with file transfer: ', err);
                   });
               }
   `
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   iPhone XR
   iOS: 12.3.1
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   Ionic:
   
      Ionic CLI          : 5.2.1 (/usr/local/lib/node_modules/ionic)
      Ionic Framework    : ionic-angular 3.9.5
      @ionic/app-scripts : 3.2.2
   
   Cordova:
   
      Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms : ios 5.0.1
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, (and 27 other plugins)
   
   Utility:
   
      cordova-res : not installed
      native-run  : 0.2.7 
   
   System:
   
      Android SDK Tools : 26.1.1 (/Users/travis.bradfield/Library/Android/sdk)
      ios-deploy        : 1.9.4
      ios-sim           : 8.0.1
      NodeJS            : v10.15.0 (/usr/local/bin/node)
      npm               : 6.9.2
      OS                : macOS Mojave
      Xcode             : Xcode 10.2.1 Build version 10E1001
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org