Phonegap Filetransfer works on iOS nothing happens on Android -
Now, I have an issue to upload some images on the server I fully working on my code iOS devices, But when I'm trying to upload to Android, it does nothing, just before Filetransfer, I'm trying to alert ImageURI, but it's not going to be okay.
I am using PhoneGap build with PhoneGap version 3.4.0 and Touch 2.3 of the Seten. In the config.xml, I use the Core Phonegap Camera Plugin: my file upload script looks like this: If anyone can see the problem, then I really appreciate the help! thank you in advanced. My problem was resolved by upgrading to PhoneGap version 3.6.3. & lt; Gap: plugin name = "org.apache.cordova.camera" />.
Ext.define ( 'my_app.controller.Fileupload', {detail: 'Ext.app. Controller ', requires: [' Ext.MessageBox '], config: {Rifः {fileupload:' #fileupload ', getLibraryImage:' button [action = getLibraryImage] ', getCameraImage:' button [action = getCameraImage] '}, control: {getLibraryImage: {tap: 'getLibraryImage'}, getCameraImage: {tap: 'GetCameraImage'}}}, getLibraryImage: function () {navigator.camera.getPicture (this.fileupload, onFail, {destinationType: Camera.DestinationType. FILE_URI, Source Type: Camera.Picture.SourceType.PHOTOLIBRARY, PermissionEdit: True, TargetWind: 800, TargetSite: 800}); Function Onfile (NO Esh) {alert ( 'failed because: "+ Message);}}, getCameraImage: function () {navigator.camera.getPicture (this.fileupload, onFail, {destinationType: Camera destination type. FILE_URI, source type: Camera. Piccrsorstaip Camera, quality: 100, allow edit: true, target width: 800, target light: 800}) file on function (message) {warning ('failed because:' message); }}, Fileupload: function (imageURI) {warning (imageURI); Ext.Viewport.setMasked ({xtype: 'Lodmask' message: Loc.t ( 'LOADMASK.FILEUPLOAD'), style HTML Contant true indicator: true}); Var option = new FileUploadOptions (); Options.fileKey = "file"; Options.fileName = imageURI.substr (imageURI.lastIndexOf ('/') + 1); Options.mimeType = "image / jpeg"; // if (Ext.os.is ('Android')) // // options.chunkedMode = true; //} var user = JSON.parse (localStorage.getItem ('user')); Var user_id = user.id; Var Username = user.username; Var params = new object (); Params.user_id = user_id; Params.username = Username; Options.params = params; Var ft = new FileTransfer (); Ft.upload (imageURI, encoder UI ("my_upload_uri"), win, fail, option); Function win (response) {if (Ext.JSON.decode (response.response) .error) {Ext.Viewport.setMasked (wrong); Ext.Msg.alert ('my_app', Ext.JSON.decode (response.response) .error); } Other {my_app.app.getController ('Basic'). Profile image (); Ext.Msg.alert ('my_app', Ext.JSON.decode (response.response) .success); }} Function failed (error) {Ext.Viewport.setMasked (wrong); Warning ("An error has occurred: code =" + error.code); }}});
Comments
Post a Comment