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
muneeswar umuneeswar u 

I have a requirement where the component should allow a file of size below 10MB using the lightning component.

Hi All,
Created a FileUpload Lightning component using lightning:fileUpload.Using this I am able to upload files successfully.
I have a requirement where the component should allow a file of size below 10MB using the lightning component.
If the file size exceeds more than 10MB then we should show throw some message
Here in the Jscontroller, I was not able to get the selected file size.
can someone help me to achieve this requirement?
ANUTEJANUTEJ (Salesforce Developers) 
Hi Muneeshwar,

>> As per documentation (https://developer.salesforce.com/docs/component-library/bundle/lightning:fileUpload/documentation): "File Upload Limits
By default, you can upload up to 10 files simultaneously unless your Salesforce admin has changed that limit. The org limit for the number of files simultaneously uploaded is a maximum of 25 files and a minimum of 1 file. The maximum file size you can upload is 2 GB. In Communities, the file size limits and types allowed follow the settings determined by community file moderation."

There is an implementation for a larger file in the below link you can try checking this:

>> http://peterknolle.com/file-upload-lightning-component/

>> https://salesforce.stackexchange.com/questions/248910/how-to-upload-large-files-in-lightning

Please do note that you cannot use this component in a Visualforce page using Lightning Out, as the only supported experience for this component are:

1.Lightning Experience
2.Lightning Communities
3.Salesforce Mobile App

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
 
muneeswar umuneeswar u
Hi Anutej,
Thanks for the response.

As you said we can upload a file of up to 2GB.

But here my need is to get the uploaded file size using the lightning component in jsController in order to process some other operation.
Can you help me with this.

Thanks.