{"action":"created","issue":{"url":"https://api.github.com/repos/PhilippKrone/react-native-fileupload/issues/3","labels_url":"https://api.github.com/repos/PhilippKrone/react-native-fileupload/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/PhilippKrone/react-native-fileupload/issues/3/comments","events_url":"https://api.github.com/repos/PhilippKrone/react-native-fileupload/issues/3/events","html_url":"https://github.com/PhilippKrone/react-native-fileupload/issues/3","id":122099775,"number":3,"title":"App crashes when trying a POST","user":{"login":"BigPun86","id":7880624,"avatar_url":"https://avatars.githubusercontent.com/u/7880624?v=3","gravatar_id":"","url":"https://api.github.com/users/BigPun86","html_url":"https://github.com/BigPun86","followers_url":"https://api.github.com/users/BigPun86/followers","following_url":"https://api.github.com/users/BigPun86/following{/other_user}","gists_url":"https://api.github.com/users/BigPun86/gists{/gist_id}","starred_url":"https://api.github.com/users/BigPun86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigPun86/subscriptions","organizations_url":"https://api.github.com/users/BigPun86/orgs","repos_url":"https://api.github.com/users/BigPun86/repos","events_url":"https://api.github.com/users/BigPun86/events{/privacy}","received_events_url":"https://api.github.com/users/BigPun86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-14T18:18:51Z","updated_at":"2015-12-15T08:37:48Z","closed_at":null,"body":"I am trying to upload a image from FileSystem, which is jpg Format. But i get the RedBox Message \"could not invoke FileUpload.upload\"\r\n\r\n<img width=\"427\" alt=\"screen shot 2015-12-14 at 19 11 24\" src=\"https://cloud.githubusercontent.com/assets/7880624/11789564/6b1b365e-a297-11e5-8e21-a5d213538c6a.png\">\r\n\r\nThis is my code:\r\n\r\n    var FileUpload = require('NativeModules').FileUpload;\r\n    var UIImagePickerManager = require('NativeModules').UIImagePickerManager;\r\n        UIImagePickerManager.showImagePicker(options, (didCancel, response) => {\r\n            console.log('Response = ', response);\r\n            if (didCancel) {\r\n                console.log('User cancelled image picker');\r\n            }\r\n            else {\r\n                fileName = response.uri.substring(response.uri.lastIndexOf(\"/\") + 1);\r\n                fsPath = response.uri;\r\n                var binaryResponse = response.data;\r\n                const obj = {\r\n                    uploadUrl: API_URL + 'user/avatar',\r\n                    method: 'POST',\r\n                    headers: {\r\n                        'Authorization': AuthStore.getUserTokenWithBearer()\r\n                    },\r\n                    fields: {\r\n                        'hello': 'world',\r\n                    },\r\n                    files: [{\r\n                        filename: 'image',            // this is what your server is looking for\r\n                        filepath: response.uri,     // uri from response (local path of image on device)\r\n                        filetype: 'image/jpeg'\r\n                    }]\r\n                };\r\n                FileUpload.upload(obj, (err, result) => {\r\n                    console.log('upload:', err, result);\r\n                });\r\n            }\r\n        });\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/PhilippKrone/react-native-fileupload/issues/comments/164685378","html_url":"https://github.com/PhilippKrone/react-native-fileupload/issues/3#issuecomment-164685378","issue_url":"https://api.github.com/repos/PhilippKrone/react-native-fileupload/issues/3","id":164685378,"user":{"login":"BigPun86","id":7880624,"avatar_url":"https://avatars.githubusercontent.com/u/7880624?v=3","gravatar_id":"","url":"https://api.github.com/users/BigPun86","html_url":"https://github.com/BigPun86","followers_url":"https://api.github.com/users/BigPun86/followers","following_url":"https://api.github.com/users/BigPun86/following{/other_user}","gists_url":"https://api.github.com/users/BigPun86/gists{/gist_id}","starred_url":"https://api.github.com/users/BigPun86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigPun86/subscriptions","organizations_url":"https://api.github.com/users/BigPun86/orgs","repos_url":"https://api.github.com/users/BigPun86/repos","events_url":"https://api.github.com/users/BigPun86/events{/privacy}","received_events_url":"https://api.github.com/users/BigPun86/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T08:37:48Z","updated_at":"2015-12-15T08:37:48Z","body":"Won´t work for me :(\r\nApp crashes without any reports..."}}