You need to sign in to do that
Don't have an account?
crop1645
Internal server error - inputFile - SOLVED
Scenario:
- VF Controller Extension interacting with a VF page containing an inputFile component.
- User fills in form; including filename
- User clicks commandButton that calls action method on VF controller
- Validation rules within action method execute within context of try - DML statements - catch block
- Errors caught and set on page via Apexpages.addMessage(...) method call
- SFDC displays page with Internal Server Error !?!
Solution in succeeding post
OK, here's the solution
The error is because the view state size is exceeded through holding onto the inputFile value attribute between the commandbutton action and the page redisplay with validation errors. The VF viewstate size is 128KB. In some file upload cases (like mine), your upload file will be more than 128KB (like uploading PDFs).
In your VF controller, change your variable that holds the inputFile Blob from:
to:
and Bob's your uncle.