8

As an alternative, I considered assigning the current User Id to the File Uploader, so all attachments will be linked to the user, and then I could run some code in my save() method later to re-assign all of the User's uploaded files to the newly created ticket, but that assumes that the user doesn't have other files that would be moved accidentally. If you ...


5

From documentation: File uploads are always associated to a record, hence the recordId attribute is required. As for: I have also checked in a stand alone app The reason is because it's not supported in stand alone app Usage Considerations This component is not supported in Lightning Out or standalone apps, and displays as a disabled input. The ...


5

I did a quick test and it is indeed possible to upload a file using guest user in a community. Below are further details on your specific questions. Is it possible to upload files as a guest user in a community? Yes. Or does this checkbox/setting only work with the aura component file:upload? The Org setting is applicable for LWC as well. Could I ...


5

The amount of heap used is the same in all types of orgs; one byte of data is still one byte of data. Once you go over 6MB in a single transaction, Salesforce may choose to terminate the process (or not). More heavily loaded instances are more likely to more strictly enforce the limits to ensure all users get fair access to resources. This may be your ...


4

What would be the maximum size of a blob that I can pass from the JS side to APEX. It was documented to be 1 mb from lightning component to Apex in 1 transaction. However I do not find that documentation now. Also in my testing it started throwing error after about 716kb Is using a @wire method to get to APEX the best approach here? If not what would ...


4

The API name of the custom field must end with fileupload__c. Please refer to documentation https://developer.salesforce.com/docs/component-library/bundle/lightning-file-upload/documentation


4

Reading a file is asynchronous. This means that the upload code will happen before the files are read, and there won't be any files to read, so nothing happens. Instead, you need to wait for the files. I'd use a method to read the files that is asynchronous: readFile(fileSource) { return new Promise((resolve, reject) => { const fileReader = ...


3

Partner support have replied to me and provided a working solution! Follow this tutorial https://developer.salesforce.com/blogs/developer-relations/2017/05/build-lightning-file-uploader-component.html but change the file upload apex class to 'without sharing'. Then embed the component within a flow following from the record creation passing through the new ...


3

ContentVersion works very different from Attachment Object. When you have a trigger on it for before insert, You will get these value in trigger.new:- ContentVersion:{Id=null, ContentDocumentId=null, IsLatest=false, ContentUrl=null, ContentBodyId=05TB000000AUAAuMAP, VersionNumber=null, Title=Capture, Description=null, ReasonForChange=null, SharingOption=A,...


3

From your parent component, you can use aura:method to call child component method. Define this in child component <aura:method name="sampleMethod" action="{!c.doInit}" description="Calling chld method"> and in the parent component's handleUploadFinished method call the child component method. var childCmp = component.find('childCmp'); //childcmp ...


3

Unfortunately, process builder on content objects is not supported. You can vote the idea here and maybe it can make it to the roadmap. Alternatively, you can write a trigger on the Content object to update related opportunity and you can always write a process builder on the opportunity but it would seem counter-intuitive based on your scenario.


3

There's a third option. You can use lightning:input type="file" option if you want the look and feel without saving the file to Salesforce.


2

I assume you are wanting to have a CloudPage form where a customer can fill in their details and then attach a file - which you then want the file to upload to the FTP server ? Ampscript and SSJS do not support much in terms of file manipulation on FTP; and it wouldn't be an approach I would suggest either, as the FTP is your 'back door' for getting data ...


2

You can do this but not directly. You would have to run a data extract on the data extension the form goes to and transfer it into the ftp. You can put these two into an automation in automation studio and run this job in 1 hour batches


2

Apex Code can't read or write files directly to your computer. There's too many layers of security and other limitations that prevent this from happening. Literally, what you're doing in your code is saving the file's full path into the Attachment, which would only work for plain text files, but it still wouldn't be your intent, which is to read and upload ...


2

In one of the orgs I have worked in we wanted to be able to do something similar. What we ended up doing was creating an additional submit button called 'submit and upload files'. When the user clicked this it would submit the case, get the Id, and then open a file upload component where the user could attach one or more files to the case. When the user was ...


2

The way you can achieve it would be hosting your vfpage in a lightning component using an Iframe and use postMessage() function to send parameters from lightning component to vfpage. Your lightning component that hosts the vfpage: <aura:component implements="flexipage:availableForAllPageTypes" access="global"> <aura:attribute ...


2

You need to forcibly add the component to an Object record page, otherwise the ID will not bind to your component attribute, I had the same behavior a while back when implementing it. Note, the component whne using it with a community record page: and Home page: eventhough i have a default recordId as you do.


2

Been searching for the answer and think I may have found it! Apparently, the event will not fire in standalone apps or lightning out. To test I put the same component on a record page and, behold, it works. Something that would have been nice to have somewhere in the documentation...


2

It's on the ContentDocumentLink under Visibility as shown here Visibility can have the following values. AllUsers—The file is available to all users who have permission to see the file. InternalUsers—The file is available only to internal users who have permission to see the file. SharedUsers—The file is available to all users who can ...


2

Do you want lightning-file-upload in lwc ? A lightning-file-upload component provides an easy and integrated way for users to upload multiple files. The file uploader includes drag-and-drop functionality and filtering by file types. Below is the code for your reference <template> <lightning-file-upload label="Attach receipt" ...


2

I don't think you can do it due to the external sharing restrictions on the object for the site guest user. Even if you manage to find some workaround using without sharing in apex etc., be mindful of the new security updates coming up for the guest user documented here. That means that as of March 2020 the user will be even more locked down and limited to ...


2

I've used a workaround that uses a "Decision" if there is no file attached. If the file ID I am passing through is blank, I have it show a screen that informs them a file is required and then takes them back to the file upload. Hoping they will come out with a way to do this without the workaround!


2

Instead of DistributionPublicUrl Use ContentDownloadUrl SELECT ContentDownloadUrl FROM ContentDistribution WHERE ContentDocumentId You must get the ContentDownloadURL in the Image Source of the Site that you want to use.


2

you could always check for the attachment body or name - your att variable might never be null, but body and name might be.


1

You'll need to implement workarounds as of now if you need custom functionality w.r.t uploading files. The max content limit for AuraEnabled methods as mentioned by Pranay Jaiswal is 4MB, which is also reduced when it is encoded into base64 and gives you a final size limit around 1.5 -2 MB that you'll be able to upload. One of the workarounds would involve ...


1

You might try creating a wrapper component for lightning:fileUpload that exposes a validate method. The method could check if the user has uploaded anything and return the custom error message. Here is more info on the validation method: https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_forcecom_flow_validate_attribute.htm


1

I'm glad to announce that this issue is now solved in Spring '20 patch 7.0. Please check it out here: https://success.salesforce.com/issues_view?id=a1p3A000001YnzNQAS


1

It appears that your file, at the time of upload, was encoded in some other encoding - perhaps ISO Latin-1 or Codepage 1252. All strings in Salesforce are required to be encoded in valid UTF-8. Converting encodings in Apex is not supported natively. Instead, convert the file at the point of origin to UTF-8 encoding and upload that version. This is possible ...


1

In Store Output Values you have Content Document IDs and Uploaded File Names. You can use text collection variables for storing these. You can show these details after clicking on done. --- added --- If the collection variable is shown in same screen, its not updating. Instead you need to put the collection variable in next screen in Output text. On next ...


Only top voted, non community-wiki answers of a minimum length are eligible