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
arun kumar 577arun kumar 577 

hi guys i need your help on javascript code or apex code for pdf file extension erro message

hi friends,

I need urgent requirement on pdf file size error code if i cross limit of 1mb.

if it is javascript or apex code pls forward urgently
Aman MalikAman Malik
Hi Arun,
Below is a javascript solution.
var maxFileSize = 1000000;
var file = document.getElementById('attachmentFile').files[0];
console.log('file.size--'+file.size);
if(file.size > maxFileSize) {
//do whatever you want
}
Thanks