function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
deni kurniawandeni kurniawan 

Upload attachment to salesforce and display to Android apps

Hi everybody
I'm make an Android application, in my apps it can to upload attachment some like picture to salesforce
but I still difficulties about it..so any someone help me tell about the step?

Thank you
logontokartiklogontokartik
Hi, 
I am not sure what procedure you are using, please take a look at this blog on how you can use Salesforce Mobile SDK and also ability to upload pictures. Maybe this will give you a direction.
https://developer.salesforce.com/page/Developing_Hybrid_Apps_with_the_Salesforce_Mobile_SDK


http://www.sundoginteractive.com/sunblog/posts/upload-an-image-from-your-mobile-device-to-salesforce-using-cordova
deni kurniawandeni kurniawan
Hi, Kartik

I make a Native Apps with the salesforce_Mobile_SDK
I will make this apps to insert new data to the salesforce and upload image too but, I feel trouble about that
Gaurav KheterpalGaurav Kheterpal
What is the issue you are facing? The approach is to read the file locally and then send a POSTrequest to /services/data/v26.0/sobjects/attachment/{parent record id}/body endpoint.

You can find sample code here, this is for audio files but the approach is common for image files as well - http://stackoverflow.com/questions/13839183/how-to-upload-an-audio-file-in-salesforce-using-android-development
Dhiraj Sharma 10Dhiraj Sharma 10
I am having similar problem. Agreed i need to send a POST Request as i am unable to do with SDK. However what url i have to use for POST Request. I had made a custom field of Rich Text Area in my Opportunities object for image upload...can anyone provide the android code for same?