I want to store the image from canvas. I created a function to pass the data to Apex.

function callActionFunction(){
    var test= document.getElementById("{!$Component.descriptionTxt}");
    return true;

<apex:actionFunction action="{!insertSnapShot}" name="sendEmailAF" rerender="thePanel" oncomplete="closePopUp('popup-x');" status="sts" >
    <apex:param assignTo="{!strImageBlob}" name="imageBlob" value=""/>

When code comes to sendEmailAF..It displays "View State exceeded" considering image data size. How can i fix this issue?


Instead of using visualforce tags use Javascript Remoting .

With Javascript remoting you will get a limit of 15MB and nothing is stored in the view State .

Because you aren’t using forms and there’s no view state associated with the request, you have to manage the state of the page yourself, on the client side.

| improve this answer | |

Change your strImageBlob variable to transient. You can save the data in your apex code, and then it will be discarded from the view state:

public transient String strImageBlob { get; set; }
| improve this answer | |
  • If this data needs to be managed as a state back and forth ,using transient might not be an option . – Mohith Shrivastava Sep 22 '17 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.