Questions tagged [files]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
60 views

Can I push a file (ContentDocument) out from Salesforce to a File Repository?

Does Salesforce support capability to push out a File (not attachment) from SF onto a REST endpoint?
0
votes
1answer
3k views

How do I create a new ContentDocument Version in apex?

I'm getting insufficient privileges error when I try to create a new version for an existing file in apex. Code used to create new version: ContentDocumentLink cdl = [SELECT ...
2
votes
1answer
2k views

ContentVersion Content-Type

I need to stream a file from Salesforce in our webapplication. To make sure the file is properly opened, I have to set Content-Type header. How to retrieve the Content-Type (MIME) of a file? I ...
1
vote
0answers
123 views

Reference Salesforce “Files” in formula fields and emails

We all love Static Resource, but there is huge limitation - the file size cannot be more than 5mb. For most JS files, it is OK, but not so good if you are storing images, even when you zip them up. ...
0
votes
1answer
242 views

Salesforce Files Connect and Azure: “Error: Invalid URL”

As of 2018-02-19, Salesforce's official "preferred" instructions to set up Files Connect with Azure/SharePoint include the following: Authorize Endpoint URL: Enter the URL as follows: https://...
1
vote
0answers
167 views

Some ContentDocument is not returned by the query

I am facing a weird problem on the Files. Am trying to get all the ContentDocuments shared with "Any user in your company" with "Viewers" permission and change the access to "No Access". If we ...
6
votes
2answers
6k views

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

As I understand, the multiple attribute, when set to false, will limit the number of files uploaded at a time to 1: Specifies whether a user can upload more than one file simultanesouly. This value ...
0
votes
2answers
430 views

How to move all the documents to File to make them available in lightning

We have a requirement where we need to move all the documents to File to make them available in lightning. We tried to export all the documents using fileExporter (AppExchange app), but we are facing ...
0
votes
2answers
990 views

External FTP File Transfer Activity Error in Automation Studio

I configured a Data Extract (Data Extension Extract) and a File Transfer (Safe House to External FTP which is also an SFMC FTP ). Unfortunately, File Transfer fails without giving a proper error. ...
5
votes
1answer
174 views

How can I make file public in Salesforce to fix a sharing error?

When I try to share a file in Salesforce, I get the error that The maximum number of times this file can be shared has been exceeded Which means it is shared > 100 times. The documentation ...
-1
votes
1answer
374 views

Error while uploading File to S3 from Apex

I am using the below code to upload file to Amazon S3 from Apex class. public void uploadToAmazonS3 () { String filename = this.record.File_Name__c; String attachmentBody = EncodingUtil....
1
vote
2answers
1k views

Unable to create ContentDocumentLink from Force.com Site User

I have a requirement where I have to provide functionality to Anonymously upload File to Opportunity. I want to attach their uploaded content as Files instead of Attachment. I am able to create ...
1
vote
1answer
586 views

Using lightning:fileUpload component for uploading files without chatter Spring 18

I created a lightning component for uploading files due to the fact that in my business case, users are not meant to have access to chatter. So I opted for a component to do so, however when I try ...
3
votes
1answer
175 views

Body not a variable of ContentVersion?

I am drafting up a couple of unit tests for this code. Here is what the code looks like so far: public class ContentController { public ContentController() { file = new ContentVersion(...
1
vote
1answer
977 views

How to unit test file uploading?

The code as written below uploads a file to salesforce, then redirects the user to a specific page. public class ContentController { public contentController() { file = new ...
0
votes
1answer
25 views

File previews in binary

We have a functionality to create leads out of Emails. To do this we have a custom class in which we extract the details of the customer from the inbound email and add the email as an attachment. This ...
1
vote
1answer
270 views

Files Upload to Salesforce, but not Lightning Experience

Off of this question, I attempted to write code to upload a file to the Files tab in lightning exeperience. Here is the code I used from the salesforce guide: 01<!-- Upload a file and put it in ...
6
votes
1answer
148 views

Bulkifying trigger on Email Attachments

I created a trigger that copies all incoming email-to-case attachments to Files so that users can select these's files when forwarding emails etc. The code I have so for is: trigger CaseAttachment on ...
7
votes
1answer
4k views

Content Document download URL params

I spend hours to find a way to control download behavior of pdf-files (when to download and when to show inline) and did not find anything. What I got so far: the main thing that do all files ...
1
vote
0answers
171 views

Salesforce files unable to access document with partner user

We have the following scenario: - Partner user as access to Campaign record - An internal user add a File related to this Campaign Record Partner user is not able to access the content document, and ...
5
votes
4answers
852 views

Is there a tool to run all tests and generate a coverage report?

I want to run all unit tests on my org and download the code coverage report. The best for me is editable excel format. Is it somehow possible? Do you know any useful tools for apex unit tests to ...
1
vote
1answer
62 views

Can feature content be configured in lightning experience

In SFDC Classic,I'm able to select content/files to “feature” and they appear in a featured section under libraries I cannot find the same featured content files list in lightning experience. Can ...
0
votes
2answers
225 views

How to upload files as a FeedItem with file Attachment onto a record from Lightning?

I have been using this code to add the ability to take pictures of inventory once the customer has audited it- http://www.sfdcmonkey.com/2017/09/25/file-upload-lightning-component/ However, we need ...
0
votes
0answers
391 views

Convert legacy attachments into the files

I need help to convert legacy attachments to files with lastmodifieddate of file is equal to created date of attachments by using apex code. I need to do it for all objects on which attachments are ...
0
votes
1answer
959 views

How to create a File (a la Lightning) and link it to a Case via REST API?

In the Lightning UI if you attach a file to a Case it won't be created as an Attachment, rather as a File. I could not find anything about this in the REST API docs. What I found just by try and ...
0
votes
1answer
403 views

File SOQL query

I need to search for Partner Accounts that don't have a Partner Agreement attached in the Files section. To find that, I believe the best way is to get a list of all Files attached to the Accounts ...
0
votes
1answer
86 views

How to create a Chatter File from a big base64 string to image png

I have a problem with chatter files, I have a webcam theese webcam take a snap and I need upload this snap to chatter entry in a Chatter of custom object. After of take a picture with the webcam I ...
1
vote
0answers
341 views

Attach File/ContentVersion into a standard visualforce email template

I have an api that gets pdf invoices and stores them as Salesforce Files. I then want the sales rep to be able to send the email template with the pdf attached. Using standard visualforce email ...
0
votes
1answer
173 views

Bulk loading SalesForce Files

I need to load around 250 GB of files from a local SAN into SalesForce. I have tried using dataloader to push blobs of the files into the ContentVersion object - but because of the size and volume ...
3
votes
1answer
240 views

What contributes to Salesforce File Storage?

I was asked by one of my colleagues to delete the the files of one inactive user since he's currently the top user by file storage. I know I can delete some of his files in the documents tab but is ...
1
vote
2answers
1k views

I want to associate File With Custom Object but getting Error

I am trying to create new File through ContentVersion and Associating it with Custom Object ParentId is ID of Custom Object . Error given is Document: You cannot create a link for a document in a ...
1
vote
2answers
642 views

Notes and attachment in Winter'18 release

In winter'18 Notes & Attachments related list will no longer have an Upload File button. In my application, I am inserting the attachment using apex code. I just want to confirm if we can still ...
0
votes
1answer
443 views

Connect to SharePoint from Apex using Files Connect API

I'm trying to create a Lightning component that lists the files in a SharePoint Folder. The opportunity has a custom field specifying which folder to list. I can see the files when I navigate to the ...
4
votes
1answer
631 views

How to prevent duplicate File (ContentDocument) if the same file is uploaded at multiple records?

This is a day-to-day use case: Assume there are many Opportunities on an Org. Now Sales-Reps are uploading some auxiliary information as Files in Lightning using the standard related list and there ...
0
votes
1answer
745 views

New drag and drop lightning control in Attachments

I'm trying to figure out if this: https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_files_related_list_drag.htm Is available as a lightning component to use in your own ...
0
votes
2answers
781 views

Relation files to custom object

I have a custom object (name: mediadata), I've stored some files in the different items at the custom object. How can I get the information about the files via query? I use for attachments the query ...
2
votes
1answer
2k views

PDF File preview

In Salesforce lightning in files/notes&attachments of a contact or account you can see a preview of the first page from the pdf. How is that possible? Here is the code which I extract from the ...
2
votes
1answer
645 views

How to clear a lightning:input type=“file” with Locker Service enabled?

I have a file input like this: <lightning:input aura:id="fileInput" type="file" label="{!v.label}" name="file" multiple="true" ...
3
votes
0answers
3k views

Using Lightning input file

I've been using the lightning:input type="file" <lightning:input type="file" label="Attachment" name="file" multiple="true" accept=".docx, .doc, .xlsx, .zip" onchange="{! c.handleFilesChange }"/&...
0
votes
2answers
23 views

Storing files with a managed package

I've a managed package, and it needs to read some meta data (mostly list of values for some dropdown lists) from an external API. All lists may come around to ~100KB or so. I was thinking if I could ...
3
votes
2answers
6k views

Display image which is stored in files

How can I display an image which is stored in files? For attachments I can use the code below, but it doen't work for files. <apex:image id="Stat1" URL="/servlet/servlet.FileDownload?file=...
2
votes
1answer
824 views

Public Imageurl

We're looking for a way to upload a picture, either as Attachment, File or Content Delivery. We want to use that Image on an external website. We just need to get a public URL of the photo itself (no ...
0
votes
1answer
451 views

Lightning File Uploader in communities as external user?

Our team is trying to create a generic file uploader lightning component to use as a base component for a set of forms that need to be displayed in a community, but we keep finding issues or ...
1
vote
1answer
2k views

Salesforce Files Vs Salesforce CRM Content [closed]

Which one is the future? Or shall they continue to coexist? Can there be a scenario where both features are recommended to be used in tandem or interchangeably?
0
votes
1answer
307 views

Best way to upload Chatter file

According to this document, In version 36.0 and later, you can’t create a feed post and upload a binary file in the same request. Upload files to Salesforce first, and then use the file IDs to ...
0
votes
0answers
297 views

Convert ContentVersion blob to bytestream for OneDrive Upload (MS Graph API)

I'm attempting to upload a file (VersionData from ContentVersion) to OneDrive using the Graph API Resumable Upload Method: https://dev.onedrive.com/items/upload_large_files.htm I'm able to create ...
1
vote
1answer
1k views

Attach File/Attachment to Custom Object through API?

I need to upload pdfs to some custom objects in SF through the API. Right now I am using restforce in ruby to interact with the API, but I can't seem to figure out how to (neither in restforce nor in ...
5
votes
0answers
790 views

Files: Why ContentVersion /sfc/servlet.shepherd/document/download/ sometimes sets Content-Disposition=attachment and sometimes =inline

I need to view and PDF file stored as an attachment inside an IFRAME in this context: Visualforce: Why the display of an PDF-File inside an IFRAME works on a Sandbox but not in Production? Inspecting ...
7
votes
1answer
745 views

Visualforce: Why the display of an PDF-File inside an IFRAME works on a Sandbox but not in Production?

On a Visualforce page I have an IFRAME like this: <iframe class="viewer" src=""></iframe> It starts up an shows nothing because src is blank. Good. To store the actual PDF I upload it as ...
1
vote
0answers
79 views

Return all documents for record on public site

I have a public site where I pass a record id via URL parameter. I show the related list of the files. I can do this when I preview the site from the developer console. But when I do this from the "...