function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
you can use the filesize attribute on the apex:inputFile to pass the filesize to a controller variable
VisualForce page
<apex:inputFile value="{!attch.body}" filename="{!nameFile}" filesize="{!fileSize}" id="file" styleClass=""/>
Apex Class:
public Integer fileSize { get; set; }
if(fileSize > 5242880))
{
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'File is not Uploaded:Max.File Size is 5MB'));
return null;
}
Best regards
Naga Kiran