New answers tagged

0

Either (a) your OS is mis-configured to flag CSV files as Excel files, or (b) you actually saved this as an Excel file, which is not a CSV file. Try opening your "Excel" file in Notepad (Start > Accessories > Notepad on your computer). If it looks like a CSV, then you'll need to do some troubleshooting to figure out why that's happening (probably outside the ...


0

You just need to follow the directions found in Insert or Update Blob Data (REST) or by calling create() on an appropriately created ContentDocument and ContentDocumentLink using the SoapClient method. To actually call the API, use the curl methods provided by PHP. This is actually fairly trivial if you've already gotten as far as making API calls to begin ...


1

A single File (ContentDocument) can have many Versions (ContentDocumentVersion) which all link to the same record (ContentDocumentLink). Your code is pulling all the versions for the record which will include current and old versions. The easiest fix is to include isLatest to only pull the latest version of files. List<ContentVersion> versions = [...


1

You have a single imageURL, and its not part of the list of attachments try <apex:image url="{!'/servlet/servlet.FileDownload?file=' + atch.attachobj.Id}" style="max-width:100px;max-height:100px;"></apex:image> and get rid of the imageURL declaration and also imageURL='/servlet/servlet.FileDownload?file='; if(relatedAttachments.size()>0) ...


1

Your imageURL property is the same for all the records. You have to do the following: a) Update your custom class to have the imageURL in public class selectedAttachments { public Attachment attachobj{get; set;} public Boolean Selected {get;set;} public String at_size {get; set;} public DateTime at_createDate {get; set;} public String ...


-1

I am not sure why this doesn't give me correct data but I have found a work around. I am using fetch-base64 package to make request to this particular URL. I am passing the correct authorization header along with the request. const doFetchRemote = await fetch.remote({ url: instanceUrl + contentVersionObj.VersionData, headers: { '...


1

The "incomprehensible junk" is the actual binary content of the file. The URL that you receive in ContentVersion's Body field is an sObject Blob Retrieve endpoint. From that documentation: Because blob fields contain binary data, you can't use JSON or XML to retrieve this data. There's no need to perform Base64 decoding because you are directly ...


0

For anyone that may encounter this issues, it is not specified in the rest api docs, but the whole request needs to be sent in a binary format. read the file in binary format, then concatenate it with the non-binary strings after applying .encode() method on these strings. Best regards, Sharon.


3

Are you ok using an AppExchange app to address your requirements? if yes, then there's a paid app available on AppExchange Mass File Download, its perfect solution to mass-download files/attachments related to a record or multiple records in just 1-2 clicks. Check out app @ https://sforce.co/34thF8U (AppExchange URL)


0

Was able to progress with file upload. The error on top, was that the attachment needs to be outside the body, and not be set as an array: { "body": { "messageSegments": [ {"type": "Text", "text": "Attchment from Jira CFSL project"}], } "attachment": {"attachmentType": "NewFile", "title": "image-2019-07-04-16-56-15-358.png", "description": "attachment ...


2

I made a "Content Document" so I could then create a public link and use it in the front: public class PX_IRN_PDF_CTR { @AuraEnabled public static String generaPDF( Id accId1){ String url = '/apex/PX_IRN_PAGE?id=' + accId1; PageReference pageRef = new PageReference(url); Blob ret = pageRef.getContentAsPDF(); String ...


Top 50 recent answers are included