0

I have been struggling with this for too long. I have a business requirement to upload files in a community for guest users and I would say it needs to be around 30MB.

This is what I'm using for my html inside my LWC

<lightning-card title="Upload Files" icon-name="custom:custom14" class="uploadFilesCard">
    <template if:true={refreshFileInputWhenUserRemovesAnotherFile}>
        <div class="slds-m-around_large uploadFilesButton">
            <lightning-input id="selectFilesToUpload" type="file" variant="label-hidden"
                accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf" onchange={handleFilesUploaded}
                multiple required data-id="inputfile">
            </lightning-input>
        </div>
        <template if:true={filesData}>
            <template for:each={filesData} for:item="file" for:index="index">
                {file.Title}
                <span key={file.Title} data-id={index} onclick={removeReceiptImage}
                     class="removeImage">x</span>
            </template>
        </template>
    </template>
    <template if:false={refreshFileInputWhenUserRemovesAnotherFile}>
        <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner>
    </template>
</lightning-card>

-This works but the problem is, it only allows up to 2MB, I have it handling in the backend taking the files and passing it to an apex class where the apex class creates a ContentVersion and relates it to a Account that is also being inserted, there is also a ContentVersion trigger that creates a CDL and relates it to the content version.

The problem

-I need to allow larger file upload sizes, I tried using lightning-file-upload, but this directly uploads it to salesforce without allowing to control when it gets submitted, I only want the files to upload to salesforce once the user clicks Submit on my webform.

If anyone has any ideas, or solutions please let me know. I'm open to all ideas.

0

0

You must log in to answer this question.

Browse other questions tagged .