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
Nupur ModiNupur Modi 

View state issue with apex:inputfile and required field validation

I have an input file on a VF page. And there is a required field as well. The problem is that if someone uploads a file and doesn't enter the required field and clicks on Save, I am getting the "Max View State" error. Because the file goes into the view state and SF internally throws an error.

Does anyone have a solution to this issue?

Thanks in advance
Nupur Modi
PratikPratik (Salesforce Developers) 
Hi Nupur,

Please refer to this post:
http://salesforce.stackexchange.com/questions/28368/uploading-file-via-visualforce-page-error-maximum-view-state-size-limit-135kb

Also you can refer to the best practices:
https://help.salesforce.com/apex/HTViewSolution?id=000126956&language=en_US

Thanks,
Pratik
Nupur ModiNupur Modi
I am following whatever is mentioned in the post. The issue I am facing is only when there is a required field on the page and the user doesnt enter it. With this the SF internally throws an error and we do not get to the controller at all.

Nupur Modi