Questions tagged [files]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
7answers
11k views

uploading files in contentVersion using lightning component

I am developing a lightning component to upload files in the contentVersion object. I used this site as a reference: http://peterknolle.com/file-upload-lightning-component/ I was able to ...
2
votes
1answer
923 views

Query to see all Files related to specific object (Events)

The following post talks about running a query to return Files related to a specific record: How to query all files attached to the Opportunity What I'm trying to do is return ALL files related to ...
6
votes
1answer
16k views

Difference between File and Attachment in SalesForce

We have been using Notes and Attachment to store files related to the record. I also read about Files in salesforce. How are Files different from Attachment? Are there any limitations or benefits of ...
43
votes
7answers
22k views

Obtaining all ContentDocument records using SOQL

According to the Salesforce documentation on ContentDocument Users (including users with the “View All Data” permission) can only query files they have access I find this very strange. Why would a ...
6
votes
2answers
25k views

how to upload files using Apex code

I am creating a VF page to upload files to to the Files related list of an object : I found out that files object is ContentDocument object. I am figuring out how I can create this ContentDocument ...
3
votes
1answer
4k 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 ...
9
votes
1answer
5k views

Triggers on ContentObjects

We've been working with Attachment records on our custom objects, and we now need to migrate to Files (you know, that related list that shows up everywhere). We have a lot of trigger logic on ...
4
votes
2answers
8k views

Migrate attachments to Salesforce Files

One of our clients has a requirement to migrate attachments to Salesforce Files. They have also enabled this option from Winter '16 to allow file uploads to goto salesforce files instead of ...
3
votes
4answers
11k 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=...
1
vote
1answer
120 views

Retrieve Preview Image URL of Salesforce Image Files

I am trying to get the image addresses from Salesforce Files using the following query in workbench. There are thousand files, but no results are displaying. Select Id, ContentDocumentId, ...
0
votes
2answers
2k 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. ...
0
votes
1answer
7k views

Adding attachments in apex, convert the code to add Files

I was wondering if there is a simple to solve my issue, previously in apex one of the automation process was adding attachments from email, please see the code below. private void ...
18
votes
2answers
12k 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
2answers
2k 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 ...
9
votes
3answers
15k views

ContentDocument parentId

I am uploading a file via the Files related list on the Contact detail page. When I query (SOQL) the database I see the relevant ContentDocument and ContentVersion records. I would like to get the ...
7
votes
1answer
4k views

How to Upload a File to a specific Library Folder using Apex?

I am trying to save a Visualforce page as a PDF file to a Library folder in our Salesforce org. I have been unable to figure out how to save this new PDF file to a specific Library folder. I tried ...
7
votes
1answer
2k views

How to upload larger size file using input tag of type html in LWC

I have implemented custom file upload component using input file html tag and rendering it as browse file button. The issue with component is:- When trying to upload file more than 4 mb of size, i ...
7
votes
1answer
1k 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 ...
4
votes
1answer
2k views

Export and Import of Salesforce Files and Notes from one production org to another production org

I have completed a data export of an org we acquired through the following steps: In Setup, navigate to Data Management | Data Export Click on either Export Now or Schedule Export button, whichever ...
6
votes
1answer
1k 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 ...
4
votes
1answer
6k views

Files as email attachment from Apex

We have a requirement to send email with attachment. When a Opportunity stage is changed need to send a email to opportunity owner with attachments(Files added to that opportunity). This work fine ...
1
vote
2answers
173 views

How to automatically change the name of a file upon creation?

I want to automatically change the name of a file as soon as it is created. To keep things simple, let's say I want to add "test-" before the file name. I think this has to be done via a ...
1
vote
0answers
477 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 ...
9
votes
2answers
12k views

How to query all files attached to the Opportunity

I know how to query all the attachments related to the opportunity, but how to do the same for files attached. Seems like a file is a part of a content library.
2
votes
2answers
6k views

Where are the documents from the Documents tab in Lightning?

Our org has switched to Lightning recently and, as expected, there is no Documents tab. From what I've read the equivalent to Documents in LEX is Files. I would like to know where are the actual ...
2
votes
1answer
194 views

How to track deletion of Files (Content Documents) in Case Feed?

Customer is using Email2Case, configured to store email attachments as Files (Content Document/Version/Link). They specifically will allow agents to delete these files, as they get many unneeded ...
2
votes
0answers
976 views

Display image from “Files”/ContentVersion in VisualForce [duplicate]

I'm working on a project where I'll be using VisualForce to render custom PDF service reports. So my page will take in the ID of a Service object (from Field Service Lightning) and populate all the ...
2
votes
1answer
849 views

Select From Existing Files in Custom Lightning Component

I am wanted to have the option to select from files which have already been uploaded in Salesforce in a custom lightning component. I would like to build something similar to what is on the Files ...
1
vote
2answers
602 views

Option to share a file uploaded privately with a Community User

When i upload a file under Files Tab we have share option. But we can only share with internal users...but not with partner users. I was wondering if its possible to share file with a partner ...
1
vote
1answer
2k 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 ...
1
vote
2answers
2k 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
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
41 views

What data type can be used to support file uploads in Salesforce?

I have a custom object and I want to add a new field to support file attachments. For example, while creating new record, I want the user/admin to have an option to attach files to that record during ...
0
votes
1answer
146 views

Fetch Files Related to opportunity in salesforce

I want to run a SOQL query that fetches files associated with opportunities(in a particular stage). If I am not wrong content version is the actual object I need to be querying on to fetch content? ...
0
votes
2answers
457 views

Image dimensions validation with Lightning FileUpload component

We need to give an ability to user to upload an image related to Account in a Lightning Component. This can be easily done with standard lightning:fileUpload component without any need to send file ...
0
votes
1answer
248 views

visualforce page to download “Salesforce Files” [closed]

I've been asked to create a button on a Related List for Salesforce Files in Classic. So the Related List is on the detail page for a custom Contact page. I'm guessing I'll need to create a VF page ...
0
votes
1answer
251 views

Disabling 'Populate Custom Fields When Uploading Files' feature

I'm using lightning:fileUpload component to load files, and I came accross a new, unnecessary feature. Recently when adding file, the button on popup window displaying uploading status changed from '...