Skip to main content
11 votes
Accepted

What are permissions are needed to upload a file via a public Salesforce community page?

UPDATE The component is now supported for guest users with Spring '19. Let Community Guest Users Upload Files release notes. Promote file sharing in your communities. Let guest users upload files ...
Jayant Das's user avatar
  • 30.6k
7 votes
Accepted

Upload ~20mb file to Salesforce via REST API

Realistically, you're not going to be able to do this, for a variety of reasons: Heap Limits The only context that can even store 20 MB of data in RAM is Email Services. That means you'd have to ...
sfdcfox's user avatar
  • 495k
6 votes
Accepted

Check File Size on Upload in Visualforce

Just bind fileSize to an attribute: public Integer fileSize { get; set; } // ... if(fileSize > 3000000) { // Show error return; } <apex:inputFile filesize="{!fileSize}" ... />
sfdcfox's user avatar
  • 495k
6 votes

Get file from Lightning input type file

lightning:input is still beta, and has quite a few problems. It doesn't even currently have a documented files attribute at the moment. As far as I'm aware, you still need to use a native input ...
sfdcfox's user avatar
  • 495k
6 votes

What are permissions are needed to upload a file via a public Salesforce community page?

Attempt 1: As it was not possible via profiles, I tried doing it via permission set. I created a new permission set and added below permission for files Create Content Deliveries Create Public ...
Pranay Jaiswal's user avatar
6 votes
Accepted

Upload file and attach it to contentDocument

Whenever you insert a ContentVersion, Automatically a version get inserted for the file.The number increments with each version of the document, for example, 1, 2, 3. Use ContentVersion object to ...
sanket kumar's user avatar
  • 15.4k
5 votes
Accepted

Uploading an attachment with Request

As it turns out, just using the regular formData object with multiple keys was the way to go. const options = { url: 'https://instance.salesforce.com/services/data/v38.0/sobjects/Attachment', ...
John's user avatar
  • 71
4 votes
Accepted

Call Apex method from lightning component fails to execute

fr.onload = function() { ..} should be using fr.onload = $A.getCallback(function() { ..}) to make sure that your callback is run inside the Aura event loop. That could be why it gets queued but not ...
Aidan's user avatar
  • 13.7k
4 votes
Accepted

lightning:fileupload - Reduce number of files to upload to a single file at a time

After hours of pain, I found a workaround. Before this workaround, the lightning fileupload component creates an html like this: <input type="file" id="input-1" aria-labelledby="input-1-form-...
SamuelDev's user avatar
  • 790
4 votes

lightning:fileupload - Reduce number of files to upload to a single file at a time

This looks like a bug to me for sure .The component outputs a HTML tag as below for the code <lightning:fileUpload label="Attach receipt" name="fileUploader" accept=".pdf,.png" ...
Mohith Shrivastava's user avatar
4 votes

Bulk API 2.0 Upload for files bigger than 150Mb

After some tests I discovered that the API don't support more than one file per job. It fails if more than one file tries to be uploaded. So I had to split my big file and create a job for each of ...
Dan's user avatar
  • 61
3 votes
Accepted

How to unit test file uploading?

You just need to query the data to make sure it actually gets into the database. You should also test on the redirect. MyController controller = new MyController(); controller.file.Body = Blob....
Adrian Larson's user avatar
  • 150k
3 votes
Accepted

Unit Test data accessability

Tests should run synchronously during deployments, so I do not believe row locking can explain the issues you are running into. But you should never use @SeeAllData=true, except as an absolute last ...
Adrian Larson's user avatar
  • 150k
3 votes

Get file from Lightning input type file

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the ...
GoldenAxe's user avatar
  • 477
3 votes

Get file from Lightning input type file

I've been able to use lightning:input as file selector, if you set an attribute in the component to store the files. <aura:attribute name="FileList" type="Object"/> <lightning:input ...
Doug Kells's user avatar
3 votes

Load data to instance via Apex from a source file?

As mentioned in the comments, the Salesforce CLI data commands could be really useful here. The catch is that they aren't Apex based, so you will need to drop out to the command line to populate the ...
Daniel Ballinger's user avatar
3 votes
Accepted

Upload events recurrence end error

Depending on the type of event, Salesforce restricts the number of recurrences that can occur. To avoid the error, you must specify a date/time that is no later than the date in the error message. To ...
sfdcfox's user avatar
  • 495k
3 votes

Questions using Workbench: Aborting data upload; modify the batch size; turn off the auto-mapping

How do I abort a data upload in Workbench without having to go into setup in Salesforce and abort it there? There isn't a way, as far as I can tell. How can I modify the batch size while it's ...
sfdcfox's user avatar
  • 495k
3 votes

Custom Metadata Type Records Mass Insert

Similar to answer from Chris about the format. I was saving in Excel as CSV UTF-8 and this wasn't working. I tried just saving it using Excel CSV, with no other options, and it worked! I also had this ...
ddeve's user avatar
  • 1,606
2 votes

Upload assets to Site.com via FTP or REST API?

Here is an example code of how to do it to accept binary data @HttpPost global static String insertContentVersion(RestRequest req) { ContentVersion cv = new ContentVersion( // ...
Mohith Shrivastava's user avatar
2 votes

BLOB is not a valid UTF-8 string

UTF-8 only allows certain combinations of bytes, which means you can't (directly) convert binary files to strings in Apex Code. Based on my experience, I would say that you probably used Microsoft ...
sfdcfox's user avatar
  • 495k
2 votes

Prevent Upload Files from Napili Community

Here's how to restrict or limit what ALL Users in your Community can upload per Limit Files in Your Community: Community file moderation must be enabled for your org before you can limit files in ...
crmprogdev's user avatar
2 votes

enable a user to use the import wizard to upload custom object records?

To import records, following permissions are required. Please check if below permissions are given:- To import custom object data via the Data Import Wizard: “Import Custom Objects”  AND “...
Ashwani's user avatar
  • 22.6k
2 votes
Accepted

Upload File Error

The code you used is out of date now, $A has been deprecated, you now need to use $A.getCallback() instead. I've not dug deeply into this, but pretty sure this'll sort you out: $A.getCallback(...
Matt Lacey's user avatar
  • 25.7k
2 votes
Accepted

Visualforce File Upload

Returning null from your save method will leave you on the same page. The Document instance that the file upload will populate is the standard controller one: public class documentExt { private ...
Keith C's user avatar
  • 136k
2 votes
Accepted

Salesforce for Outlook mail upload

This is a default feature of 'Salesforce for Outlook'. You can control and customise this behaviour based on your preferences to disable it altogether or define rules - read more here. Additionally, ...
Gaurav Kheterpal's user avatar
2 votes

I can insert images in to Salesforce RTF fields using copy and paste functionality in my org on IE or Chrome, other users can't

This is actually a known issue under point threshold. The suggested workaround is this but that might/ might not work for certain users. Right click on the image in your browser and save the image ...
Gaurav Kheterpal's user avatar
2 votes
Accepted

How to upload application/javascript file in static resource

What I experienced in past that mime type (for static resources) depends on the browser used to upload the file. I got the below mime types for same javascript file from different browser. Chrome - ...
Saroj Bera's user avatar
  • 14.8k
2 votes
Accepted

How to restrict file-type in Standard page Attach

Here is how I able to solve the above issue: public static final List<string> CONTENT_TYPES = new string[]{'image/gif','image/png','image/jpg'}; for(attachment a: Trigger.new) { if (!...
Nick's user avatar
  • 7,030
2 votes

Limit for javascript remoting request

Using REST api is much better option than sending via remote action methods. Remote action methods have a limitation of number of character (1000000) that can be sent from a page to apex controller....
Sam's user avatar
  • 4,383

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