SAP Knowledge Base Article - Public

3604647 - Javascript Functions Added to HTML File Uploaded in MDF

Symptom

  • When an HTML file is uploaded to a custom MDF object and subsequently downloaded, some javascript functions will appear in the file footer.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental. 

Environment

  • SAP SuccessFactors HCM Suite
  • Document Management

Reproducing the Issue

  1. Login to SF instance
  2. Go to People profile or manage data
  3. Upload an HTML file to custom MDF object.
  4. Save the file 
  5. Download the uploaded HTML file
  6. Verify that the uploaded file is different from the downloaded file and some javascript functions appear in the file footer.

Cause

This is because the JavaScript functions already exists in the original file, but they were removed when the file was uploaded since the script tag could contain malicious JavaScript. When downloading it, the JavaScript function is restored and visible. 

Resolution

  1. Before uploading the HTML file, remove the JavaScript and any calls to it to maintain a working HTML file.
  2. Alternatively, the JavaScript can be removed after downloading the file.

See Also

Refer to KBA2257047- Adding attachments on an MDF Object for attachment type field via Import.

Keywords

HTML, MDF object, manage document, file upload, file download, JavaScript, script tag, code removal, style alterations, attachment , KBA , LOD-SF-PLT-DOC , Document Management , Problem

Product

SAP SuccessFactors Platform all versions