• Pooja Kadam 4
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi All,
I have created a lookup field named "oap" on opportunity. Now i need to calculate the total amount of those opportunities which is associated with a particular oap. could you please help me writing a trigger for this as i am new to apex.

Thank you.
Regards
Tanu
  • September 14, 2017
  • Like
  • 0

Hi,

 

I have to upload an image to third party storage server using REST API, It does not support 'base64' content-transfer-encoding and salesforce does not allow to send binary content using string ( I guess), because when we convert blob into string, it gets converted to ascii characters. Is there any way to convert blob into byte [ ] or binary stream to post binary content.

 

Here is my sample code for the requirement. -

 

 

<apex:form>
   <apex:inputFile value="{!fileContent}" fileName="{!name}" fileSize="{!size}"/>
   <apex:commandButton value="Upload" action="{!uploadImage}"/>
</apex:form>

/************Controller Code*************/

Public Blob fileContent {get;set;}
Public Integer size {get;set;}
public String name {get;set;}

String body = '-----------------------------153501500631101\r\n';
body = body + 'Content-Disposition: form-data; name="Filedata"; filename="testImg.png"\r\n';
body = body + 'Content-Type: image/png\r\n\r\n';
body = body + fileContent.toString() + '\r\n';
body = body + '-----------------------------153501500631101--\r\n';

 

 

Any help will be apriciated. Thanks in anvance....

 

Lakhan