+ Start a Discussion

Viewstate error for attachment

I have a requirement where user would select an image(using apex:inputFile) and clicks preview button to see the preview of the selected image and once satisfied save button will save the image to the related attachment object. Transient keyword is not helping here as the selected image has to be show as preview first and I am running into view state error for large size images as blob variable for image has to be in view state. Any workarounds with out using Javascript is appreciated.

thanks in advance.





View State will come into picture in this case. The only possible way I can think of is using HTML5, which salesforce is supporting now.



you can take the reference from the below URL:




Please let me know if u have any query on same and if this post helps u please throw KUDOS by click on star at left.