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
Prakash GBPrakash GB 

larger file upload with lightning component

How can I upload a larger file from a lightning custom component? I don't have record ID at the time of file selection
Deepali KulshresthaDeepali Kulshrestha
Hi Prakash,
May I suggest you Please read the given below points and follow below link with the help of below points and link you can solve your problem, it may be helpful to you. 

1. In below Link, you will find lightning component, js.controller, js.helper and apex controller as well, it is working fine in my Org.

2. Inside component -> <aura:attribute name="parentId" type="Id" default="0010o00002LMuvm" /> replace default Id with your record Id.

3. Inside js.helper -> MAX_FILE_SIZE: 4500000, //Max file size 4.5 MB, CHUNK_SIZE: 750000, you can replace the MAX_FILE_SIZE according to your requirement.

4. Js.controller and Apex controller will remain the same.

Follow below link for satisfying all the above points.

Link: http://sfdcmonkey.com/2017/09/25/file-upload-lightning-component/

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
Prakash GBPrakash GB
Hi Deepali Kulshrestha,

with this, I can upload only up to a 5MB file. I need a way to utilize maximum(2GB) file upload limit. 

Thanks 
Deepali KulshresthaDeepali Kulshrestha
Hi Prakash,

Please follow the given below link with the help of link you can solve your problem, it may be helpful to you. 
Lightning file upload :
Using the lightning file upload you can upload up to 2 GB file, please read the below link and follow.
Link : https://developer.salesforce.com/docs/component-library/bundle/lightning:fileUpload/documentation

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha