douglascayers / sfdc-convert-attachments-to-chatter-files

📎 Easily migrate your Attachments to Salesforce Files.
https://douglascayers.com/2015/10/10/salesforce-convert-attachments-to-chatter-files/
BSD 3-Clause "New" or "Revised" License
73 stars 29 forks source link

pdf files not opening after conversion #49

Open damodarharishTest opened 6 years ago

damodarharishTest commented 6 years ago

After converting the attachment with file type pdf, when I try to open it, showing file error message as file damaged. image

Is this known issue for pdf file conversion?

douglascayers commented 6 years ago

Hi @damodarharishTest,

I haven't encountered that before.

The conversion process simply copies the same Blob of binary data from Attachment.Body to ContentVersion.VersionData and does not do any parsing or conversion of the raw bytes themselves. It's simply a pass through from one record to the other.

Can you confirm that when you download and open the original attachment PDF it does not give you this error?

douglascayers commented 6 years ago

@damodarharishTest and follow up to my previous reply, if you upload the original attachment PDF to Salesforce as a "File", when you try to open that file as a PDF do you get any error?