You need to sign in to do that
Don't have an account?
Pranav Chitrans
Restrict validation for file size and file type while up,loading profile picture
While uploading profile picture via logged in community I want to put a validation check file size should me less than 2 mb ans type should be of JPG/JPEG and so on..I tried but not geeting through it
File to add
File to add
<apex:inputFile value="{!blbImageBody }" id="i_file"/>Button
<apex:commandButton value="Save" styleClass="btn-success" style="margin-right: 5px;" html-data-loading-text="Saving..." action="{!upload}" id="i_submit" onclick="$(this).button('loading')"/>In this line i have to perform one more jquery method that checks the validation.Kindly help me over this issue ASAP.
There is a attribute calles "filesize", you can use this attribute to restrict the filesize.
For more information -
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputFile.htm
Thanks,
Sumit Kumar Singh
And what about the type of image that it should only accept the extension like jpg/jpeg,jpig and so on
There is one more attribute called "accept". Here you can sprcify the extensions seperated by comma.
Hi Sumit,
I already used all that..But that does not work after saving the data it shows error...I have shared the part of code for that..Kindly addon on that and suggest me.
I tried this.But it have issue.Now addon this... :(