Symptom
- When attempting to upload a PDF file as an attachment in an SAP CPQ quote, the upload fails.
- The following error message is displayed: "[filename].pdf has invalid content or an incorrect extension. Please upload a valid file."
- The file has a valid .pdf extension and opens correctly in a PDF reader.
- The same file can be attached successfully in other SAP applications.
Environment
SAP CPQ
Reproducing the Issue
- Open an SAP CPQ quote.
- Navigate to the Documents tab.
- Under the Attachments section, choose Add.
- Select the affected PDF file for upload.
- Observe the error: "[filename].pdf has invalid content or an incorrect extension. Please upload a valid file."
Cause
- SAP CPQ performs security validation on uploaded files to protect against potentially malicious content.
- If a PDF file contains embedded script content — such as a <script>...</script> tag — SAP CPQ's file validation identifies the file as a security risk and blocks the upload.
- This behavior is by design.
Resolution
The embedded script content must be removed from the PDF before uploading. Two methods are available:
Method 1 — Remove the script tag manually:
- Open the PDF file in a plain text editor (such as Notepad).
- Locate and delete the <script>...</script> tag and any associated script content.
- Save the file.
- Upload the cleaned file to SAP CPQ.
Method 2 — Recreate the PDF via Print to PDF:
- Open the original PDF file in a PDF reader.
- Choose Print and select Save as PDF as the output.
- Save the newly generated file.
- Upload the new PDF to SAP CPQ.
Note: The recreated PDF will not contain embedded script tags and will pass SAP CPQ's security validation.
Keywords
pdf, attachment, upload, invalid content, incorrect extension, quote, documents, script tag, blocked file, file upload error, SAP CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Problem
Product
SAP CPQ 2026
SAP Knowledge Base Article - Public