Questions tagged [contenttype]

This header indicates the Internet media type of the message content, consisting of a type and subtype

Filter by
Sorted by
Tagged with
0 votes
0 answers

Auth API calls resulting in 400 bad requests when POSTing multipart/form-data payloads with SSJS

I'm trying to make Auth API calls to an external API Endpoint from Marketing Cloud using SSJS or AMPScript but I am getting 400 bad request errors for these calls. In talks with a contact from the ...
Chris G's user avatar
0 votes
0 answers

I am trying to download a XLS file using visualforce page getting an error #NAME? in the downloaded file. Any inputs?

Controller Code: public with sharing class XLSDemoPage_Ctrl { public String xlsHeader { get { String strHeader = ''; strHeader += '<?xml version="1.0"?>'; ...
Saicharan Reddy Kasireddy's user avatar
0 votes
1 answer

How to Download Value From Browser Local Storage To Word Document using Visualforce

We need to download a MS-Word Document from a Visualforce page which needs to contain the information from the Browser Local Storage as well. How can we fetch and download the value from Browser local ...
Jitesh Goel's user avatar
1 vote
2 answers

How to download displayed data from VF page into an excel file without querying again?

I have a VF page in which I am displaying data to users. The data is fetched from an external system. I wish to have a download button on the VF page so that users will be able to download the data in ...
Koustubh's user avatar
  • 1,133
0 votes
1 answer

Visualforce to output result of Javascript function as application/json content

I am using a Javascript library to process some JSON data in Visualforce. The result of this operation should become the output of the VF page (ContentType=application/json). I know this is easily ...
Mossi's user avatar
  • 3,906
1 vote
0 answers

The 'Content-Type' header must be modified using the appropriate property or method.\r\nParameter name

I am making a Http get request to 3rd party api using SSJS. each time i make a call is get below exception: e: {"message":"An error occurred when attempting to evaluate a Util.HttpRequest call. See ...
priyaanka chakraborty's user avatar
4 votes
1 answer

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 ...
Stijn's user avatar
  • 409
2 votes
0 answers

Visualforce generated MS Word .doc does not show file Preview

I'm generating an MS Word document .doc in Visualforce using markup as below: <apex:page controller="MyController" contentType="application/msword#myDocument.doc" sidebar="false" ...
VarunC's user avatar
  • 5,920
1 vote
0 answers

VisualForce: Dynamic Page Headers based on Parameters works as expected until adding actions to page

Background: I am working on a VisualForce page to allow our customers to 'Add to Calendar' from an email alert that they receive when we book an Event. The Apex page takes 2 parameters right now, ...
Morgan Marchese's user avatar
12 votes
1 answer

Valid values for ContentType

I am creating a KAV article using Apex code. One of fields is a file field, and I set the various fields within there: Name, Content Type, and Body. It appears that I have to set the Content Type ...
hamayoun's user avatar
  • 2,727
1 vote
0 answers

Salesforce Attachments before/after insert trigger: ContentType field value is not available

I need to write a trigger in order to prevent users from uploading some predefined file types. (Please note that I don't want to use "File Upload and Download Security" option for some other reason) ...
Hasantha's user avatar
  • 2,045
0 votes
1 answer

Anyone know the css or code to use to hide a div when VF set to contenttype/msword

I have tried @media print{ display: hidden; display: none; visibility: hidden; width: 0px; } Each time it displays a square block of text with the words {HIDDEN} in the word doc. ...
Eric's user avatar
  • 54k
1 vote
1 answer

Converting from string to blob and sending email along with attachment

I have this method public void sendEmailWithAttachment(){ Blob b; String b64; String strUrlUTF8; String sampleString=generateReport(); //call generateReport method ...
Shamsher Singh's user avatar
10 votes
1 answer

<apex:inputFile> 'accept' and 'contentType' on VF page only working when not called from mobile

<apex:inputFile value="{!attachment.body}" fileName="{!}" id="file" contentType="{!attachment.ContentType}" accept="image/*,application/pdf"/> If I call this from my desktop ...
David Renz's user avatar
2 votes
1 answer

CSV created with first row as empty. Any suggestions please

i am trying to create a csv and succeeded in that except with a new empty row has been added on the top of the csv. The following is the visualforce page code for the generation. Also, i need to use ...
Bforce's user avatar
  • 6,806