I want to make a "custom file upload" LWC component as I am in need to build a specific design for an upload process.
There are a few things I am not sure about.
- What would be the maximum size of a blob that I can pass from the JS side to APEX.
- Is using a
@wiremethod to get to APEX the best approach here? If not what would be a better way?
- Is it possible to chunk the blob, pass one chunk at a time and store it in the same
ContentVersion? Example: I will chunk the file blob depending on the size limit(heap size limit and what I can pass from JS to APEX). Then I want to pass one chunk and save it in a
ContentVersion. Then pass the next chunk, have APEX pull the
ContentVersion, append the new blob to what is already in the
ContentVersionand save. Then keep doing the same thing until all chunks have been passed to SF and appended to each other. Is this going to create a new version every time that I try to save or can I re-save in the same version?
I tried to explain my concerns to the best of my ability. Please if anything doesn't make sense let me know and I will try to elaborate.