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
Nishant SharmaNishant Sharma 

How to upload large file in lightning component with locker service enabled?

I have used forcetk library, in lightning component for uploading file in SFDC and that works perfectly fine with large files (~25MB), with Locker Service disabled.

However, when LockerService is enabled, it just stop working.

On Technical note:
I have made few changes in forcetk library to make it work for normal operations, but file upload aka createBlob is still an issue. If I go little deep, problem with file upload is, Locker Service restricts XMLHttpRequest global reference and hence end up responding bad request. Not sure, if there is any secure way of making XMLHttpRequest for file upload.
I have also tried this this link:

But that just let me upload file with small size and take LOT of processing time (as it process blob and pass the binary file as base64string).

Now, to summarize, what is the best way/tool to upload file in lightning component with Locker Service Enabled.
NagendraNagendra (Salesforce Developers) 
Hi Nishant,

May I suggest you to please check with below link from stack exchange community with similar requirement.

Please let us know if this helps.

Mark it as solved if it's resolved.

Best Regards,
Here is the Working Updated Version of Custom Large File Upload In lightning Component :)

Thanks :)