Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [contentversion]

The tag has no usage guidance.

0
votes
2answers
29 views

How to insert ContentVersion with preview in files?

I can insert an image, but it's without preview. I can open the image after downloading, but a need preview. It writes in files "No preview available". How to fix that? Here is my code. js: ...
0
votes
0answers
15 views

“No preview available” after uploading ContentVersion with Lightning

I get my test image in files, but can't to see the preview. How can I fix that? @AuraEnabled public static void save(String resumeId, String versionData){ ContentVersion ...
0
votes
1answer
18 views

Related Files Component

I have a component and apex controller that calls/displays all the related files on a record. How can I filter the returned files by a field that is set on ContentVersion? ie. only show files if ...
2
votes
1answer
54 views

How to upload a ContentVersion with lightning component?

I'm trying to use simple apex class and simple controller like a test. But can't upload ContentVersion. What is wrong here? handleFileSelected: function(component, event, helper) { let files = ...
0
votes
0answers
28 views

Insert ContentVersion without VisualForce

I've got a CSV file stored on the user's hard drive and I want to store it in Salesforce. The code I have uses Visualforce and Apex to, I think, open up the file and place the contents on a hidden ...
0
votes
2answers
34 views

Unable to get file attached to Account using Apex

I have a file firstname lastname cv.pdf attached to an Account record. I would like to get the file using apex, below is my attempt: List<ContentVersion> files = [SELECT Id, VersionData ...
1
vote
0answers
32 views

custom files related list component not reflecting new files upload

I have a custom lightning component that displays further details from the contentVersion. the customer requirement is to display both, the standard files related list and my custom cmp. now, when the ...
0
votes
1answer
28 views

Salesforce Standard API - Composite Tree resource

In order to create record in bulk using REST API, we using Composite Tree resource. I'm trying to upload a bulk of content versions : {"records" :[ { "attributes" : {"type" : "ContentVersion", "...
0
votes
0answers
43 views

ContentVersion custom field permissions

I have added a custom field to my ContentVersion standard object. Community users are uploading files, but I do not want them to be able to view or edit the new custom field. I cannot find where do ...
1
vote
1answer
87 views

Salesforce Standard API - Content Version

I'm trying to send an array of content versions via the Standard API that Salesforce suggests : Using POST method to : https://SandboxName.my.salesforce.com/services/data/v43.0/sobjects/...
0
votes
0answers
21 views

Force.com upload file via API from guest user

I am building a visual force page that sends a file from the org to our 3rd party server that modifies the file as per instruction. So far that is working fine. I need to return that document from ...
1
vote
1answer
30 views

How to query contentversion to Email Message

We have integrated Salesfroce and our Support Page, and I have to send emailmessage via rest api along with attachment lies within the email, but I don't find a relateionship between Contentversion ...
3
votes
0answers
29 views

Trying to save image from Twilio MMS to Files?

I've built an SMS/MMS Lightning Component, which displays incoming MMS images in a thumbnail, and if you click it, a full-size modal display. Now I want to add the option to Save to Files... For the ...
1
vote
1answer
150 views

/services/data/v43.0/sobjects/ContentVersion rest api Limitation

I'm using the standard rest API that salesforce suggest for upload files : /services/data/v43.0/sobjects/ContentVersion - and converting the file to base64 blob on the VersionData param. I want to ...
1
vote
1answer
114 views

FIle upload to Salesforce FIles using custom REST API [closed]

I am getting an error response "system.limitexception:Json string exceeds heap size limit\n\nexternal entry point" when testing through postman, for file upload greater than 4 MB through custom Rest ...
0
votes
1answer
33 views

When converting Classic Notes to Enhanced Notes — what object do the Converted Classic Notes live on?

I can't find them on ContentVersion or ContentDocument. If I create a NEW Enhanced Note, those live on ContentNote. But what about the converted ones? They are no longer on the Note object either.
1
vote
1answer
45 views

Set SharingOption in ContentVersion throwing exception

Here is my code : contentV.pathOnClient='/'+contentV.Title; contentV.SharingOption='Restricted'; try { insert contentV; List<ContentVersion> listBid =[SELECT Id, ownerId, ...
0
votes
1answer
81 views

content version - clone from one object to another

I am trying to clone File(s) from a parent object to child. The code I am using is doing that but the file type is set to "LINK" while doing so, and I am unable to open that file or it has nothing ...
1
vote
1answer
31 views

What kind of test can I write to check the file?

I have a controller for VF Page. This code upload a profile's image (we can see it after that) and delete it. What kind of test can help me to check this file? I need to know, is it uploaded or not. ...
0
votes
2answers
41 views

Make the test work: File insert, check this File

This code is a controller for my VF Page. It inserts ContentVersion and ContentDocumentLink. After that a candidate field Photo__c take a ContentVersion.Id value. How to check it correctly? Now ...
0
votes
1answer
209 views

ContentVersion: how to check File Type and File Size?

I need to check Max Image Size and File Type so I can display the correct error in ApexPages.Messages. I tried to do something like this: if (conVer.FileType != '') But I don't know what FileType ...
0
votes
3answers
800 views

How to convert ContentVersion VersionData to String

How would I convert CSV data stored in the VersionData field of object ContentVersion into a CSV String. According to the documentation: ContentVersion The field VersionData is of type base64 So ...
0
votes
0answers
18 views

How send an email with a content file which is stored in content object

I know how to send an email with an attachment, the document which is stored in attachments and document object using apex. But this seems to be more complex to me sending an email with a content ...
1
vote
2answers
255 views

Unable to extract bulk ContentVersion and ContentDocumentLink data using Salesforce API

Use Case: Transfer existing (and OOTB) Files that are linked with couple of custom objects (CO 1 & 2) to another Custom object (CO X)? The new custom object (CO X) has look up fields for CO 1 &...
6
votes
2answers
116 views

Query optimization for ContentVersion

For a project I wrote a query to get all needed ContentVersion records. But after the deployment to full sandbox we have seen the performance issues with it. It only happens for the first time, all ...
-3
votes
1answer
35 views

Need help for writting test class for method for extention controller [closed]

Sorry I am new with salesforce developer. I have written method for extension controller. I need help with writing test class for that method. with that method what it does is visualforce is renderas ...
0
votes
1answer
88 views

Not able to insert public group id as LinkedEntityId in contentDocumentLink object

I have written one trigger which makes file private on the creation and has another trigger which shares the file access to a public group, but the second trigger is not working since, when I try to ...
0
votes
0answers
115 views

Is downloading multiple files officially supported by Salesforce in lightning?

The url "hack" to use /sfc/servlet.shepherd/version/download/ has been documented in a salesforce blog about visualforce pages showing images, however I can't find anywhere where this is officially ...
1
vote
1answer
235 views

ContentDocumentID is not available just after ContentVersion getting inserted But available after soql query

I am inserting ContentVersion as following:- String yourFiles = 'Lets assume this is your binary string of the files'; ContentVersion conVer = new ContentVersion(); conVer.ContentLocation = 'S'; // S ...
0
votes
0answers
138 views

When using the /sfc/servlet.shepherd/version/download/<VERSION> url hack to download all related Files, can we rename the zip?

So I've been using the /sfc/servlet.shepherd/version/download/ url method to create a button to download all files related to a record. However I was wondering if there is a way to rename the zip file ...
0
votes
1answer
20 views

Exporting ContentVersion to ESB [closed]

We are currently designing an integration for exporting 20-50 Salesforce Files to an external system through our ESB. Our current plan is to send the record information and associated ContentVersion ...
2
votes
1answer
122 views

“Unable to create/update fields: VersionData” error when updating a ContentNote from Apex

I have some Apex code that inserts a ContentNote and the corresponding ContentDocumentLink. This works fine and the data can be viewed through the normal Salesforce UI. But some further code that ...
2
votes
1answer
148 views

no preview for ContentVersion when inserting from Apex

I'm using the following code to generate ContentVersion. String title = 'sample file.txt'; ContentVersion contentVersion = new ContentVersion( VersionData = Blob.valueOf(...
5
votes
0answers
58 views

How to detect a size change for a ContentDocument or a ContentNote in a trigger?

Both ContentDocument and ContentVersion have a ContentSize field documented to be: Size of the document in bytes but after adding debug code to check that field for both types for these events: ...
0
votes
1answer
142 views

How to import contentversion records(csv file) using dataloader

i have three records in csv file and three pdf files. how can i import these content version records to sandbox. i tried, but when i am uploading csv file using dataloader, i got Required fields are ...
1
vote
0answers
44 views

Translate IsPrivate check into Enhanced Notes

I am migrating notes into Enhanced Notes, How do I move the IsPrivate(Checkbox on Notes) values into Enhanced Notes? If the IsPrivate Checkbox is checked on Notes, how can I do this on EnhancedNotes?
3
votes
0answers
193 views

How can you insert a Salesforce File with Collaborator ShareType?

I am currently trying to insert a Salesforce File attached to a custom Invoice object with the Collaborator (C) permission, as described on the Salesforce Documentation. The code was originally set ...
0
votes
2answers
34 views

Trigger Cant see files not shared with running user

I have a trigger that counts attachments and files on an opportunity and rolls this up to the opp. However the trigger only sees files that are shared with the user that is executing it Is there a ...
0
votes
2answers
177 views

Retrieving VersionData with standard REST API

I am trying to retrieve VersionData with a standard REST API call from a VisualForce Page a then upload it to a S3 bucket but end up with corrupted files. I believe this is an encoding problem on the ...
1
vote
1answer
220 views

Upload large ContentVersion records

I'm using a @RemoteAction to upload files to Salesforce, saving them as ContentVersion (Chatter files). I'm uploading the base64 Blob of the file. This works great for small (<1MB) files. I am NOT ...
4
votes
1answer
37 views

Getting ContentType for ContentDocuments?

The ContentDocument and the ContentDocumentVersion do not store a ContentType (MIME) like attachments did. I am trying to pass documents using an API and this information is needed to properly pass ...
-1
votes
1answer
67 views

Get Id of Files record

Is it possible to get the ID of a file that has been attached using Files. Below is a picture and when hovering over the download link, it display the id. As seen above, the id of the attached image ...
1
vote
1answer
366 views

Displaying image in Visualforce PDF

I am trying to display an image in my PDF but am unsuccessful. I am using files to attach the images. Can someone please find out where I am going wrong? Apex code: public class findImageAttach { ...
0
votes
0answers
218 views

Downloading a file (ContentVersion) but setting MIME type

I have a lightning component within which the user can download a file (10-50MB size) in the browser. The file is stored as a ContentVersion in Salesforce. I'm using force:navigateToURL with a url of ...
0
votes
1answer
210 views

How to Upload ContentVersion into OneDrive using Apex?

I am unable to send a png file from Salesforce ContentVersion to Microsoft OneDrive. Below is my code: for (ContentVersion cv : ListFilesToBeUploaded) { Http http = new Http(); httpRequest ...
1
vote
1answer
185 views

Insert base64 string as attachment using apex dataloader

I have a .csv file which has a column containing base64 string equivalent of a image. Anyway we can load the csv file into Attachments object or ContentVersion object using apex dataloader? I know if ...
1
vote
1answer
519 views

Issue Setting ContentVersion Owner

I am getting an attachment via a Salesforce email service and in the Email service apex class logic, I query the user object by the email from address and set the ContentVersion owner as the user ...
0
votes
1answer
212 views

Trigger on Notes (lightning)

Requirement: If a note is added to either an account, contact, opportunity, task and event for particular record types and the current user is not an administrator and not a user mentioned in system ...
1
vote
1answer
100 views

Is there any way to get or edit the metadata in images posted to salesforce?

Is there a way through apex or using the VersionData of the ContentVersion for me to change that EXIF data of a ContentVersion image so that it won't register as needing to rotate? To be more ...
1
vote
1answer
233 views

Knowledge Articles in Communities Custom VF + Tabs

We are currently building a community using VF together with bootstrap to achieve the clients requirements with regards to Design. We are using KnowledgeArticles in a section and wanted to achieve the ...