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
deva mdeva m 

Profile image upload from visual force and it has to store rich text area field

Hi,

I want upload an image from visualforce page and it has to store in rich text area.

Here i tried it
<apex:page sidebar="false" showHeader="false" standardController="color__c" >
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/>
<apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"/>
<script>
    $(function(){
    $('#profile_image').change( function(e) {
        
        var img = URL.createObjectURL(e.target.files[0]);
        $('.image').attr('src', img);
    });
});


</script>
<style>
.image{
    width:120px;
    height:120px
}
</style>
  <apex:form >
  
    <apex:pageBlock >
        <apex:pageBlockSection columns="1" >
         <apex:image value="{!$Resource.icon}" styleClass="image"/>
    <input type="file" id="profile_image" value=""></input>
        </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>


Thanks if any one do this for me