function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shatrughna SalunkeShatrughna Salunke 

file type is getting changed after file downloads

Hi,

I'm send excel attachment through apex class but after download the file file type is getting changed to file, but I can see in googl sheet file is open in excel format but not after downloading

  emailAttachment.setContentType('application/xlsx');
  emailAttachment.setBody(Blob.valueOf(csvFile)); 

Note : I tried with diffrent format csv, pdf but all are not working afte downloading the file.
 
SwethaSwetha (Salesforce Developers) 
HI Shatrughna ,
Which browser are you using? Does it happen across all the browsers?Thanks
Shatrughna SalunkeShatrughna Salunke
Thanks-Swetha

I'm sending  attachment  to email using apex class and trying to open from the microsoft 365 outlook.

Thanks,
Shatrughna
SwethaSwetha (Salesforce Developers) 
HI Shatrughna ,
Apologies for the delay. Can you confirm if you have a relevant file opener like MS office? If you change the file property to .xlsx after download, does it work? Is this behaviour specific to your machine or happens for all?Thanks
Shatrughna SalunkeShatrughna Salunke
  • If you change the file property to .xlsx after download, does it work?-----> Yes it is working.
  • I tried to open from the mobile ,but it's thrwoning format is not supporting error i've installed excel app in mobile.
  • Also, I tried with diffrent machin same problem is occuring.