Comments (4)
Hi @rgoldiez -- how far are you getting with this?
from react-native-uploader.
@aroth - Thanks for the response. Still stuck.
Here's what I'm sending
{ url: 'https://bots.my.salesforce.com/services/data/v36.0/connect/communities/0DB6100000000KLGAY/chatter/feed-elements',
files:
[ { name: 'feedElementFileUpload',
filename: 'image.png',
filepath: 'file:///Users/rgoldiez/Library/Developer/CoreSimulator/Devices/4D36D070-BD5E-4C17-BF64-28331FD9A5DD/data/Containers/Data/Application/ABCFF4C9-C6E1-42E7-990D-8A3377CA2F30/Documents/images/44077641-6762-4CF3-AB27-37BC5021D4A1.jpg',
filetype: 'image/png' } ],
method: 'POST',
headers:
{ Accept: 'application/json',
Authorization: 'Bearer [__removed token__]' },
params:
{ 'Content-Type': 'application/json; charset=UTF-8',
subjectId: 'a0561000001fZIlAAM',
capabilities: { content: { description: 'Test file upload', title: 'image.jpg' } },
feedElementType: 'FeedItem' } }
I'm getting the follow response back from salesforce.
{
"errorCode":"POST_BODY_PARSE_ERROR",
"message":"Binary data included but file attachment information is missing. If providing rich JSON/XML input in multipart REST, make sure to include Content-Type header in the part."
}
Any help is greatly appreciated! Note that I'm able to use this component to upload a user profile attachment to salesforce, but that doesn't required a multipart form message... it's just a simple upload to a REST endpoint.
from react-native-uploader.
@aroth - any ideas?
from react-native-uploader.
@rgoldiez I've taken on some new work and don't have much time to dig into this specific scenario. It appears that others have had similar issues when posting data to the Salesforce/Chatter API. You can review a few of these here:
It's likely header or param naming issues as other libraries are returning the same response. Or it could be a limitation with this library -- I am not certain. Here is a working code example in Java:
http://salesforce.stackexchange.com/questions/1301/image-upload-to-chatter-post
I think it would be useful to determine what react-native-uploader
is generating and compare that to input that the Salesforce API is expecting.
from react-native-uploader.
Related Issues (20)
- Upload directly from Camera instead of Camera Roll HOT 1
- Android: NativeModules.FileTransfer does not exist HOT 6
- Response
- How do you deal with multiple upload events HOT 1
- Chunked upload support HOT 3
- undefined is not an object (evaluating 'RNUploader.upload') HOT 2
- Will I be able to use FTP protocol? HOT 1
- Unsupported URL error
- no headers in response
- Video upload support HOT 5
- Illegal callback invocation on multiple call
- Might as well support for download?
- How does this plugin work?
- Does this lib help us upload image in background?
- Build fails after adding to project (iOS) HOT 5
- It doesn't add React to import part. HOT 1
- upload undefined HOT 1
- Proposal to merge with our uploader package HOT 1
- Clarification on what is required server-side
- audio file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-uploader.