+ Start a Discussion
deva mdeva m 

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


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"/>
    $('#profile_image').change( function(e) {
        var img = URL.createObjectURL(e.target.files[0]);
        $('.image').attr('src', img);

  <apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection columns="1" >
         <apex:image value="{!$Resource.icon}" styleClass="image"/>
    <input type="file" id="profile_image" value=""></input>

Thanks if any one do this for me