Changing the types of file formats that can be uploaded
You can change the types of file formats that are supported for users to upload as managed files. By changing the supported file formats, you can add or restrict the file formats that users can upload.
About this task
By default, users can upload files in any of the following formats:
- Graphics (.gif, .jpe, .jpeg, .jpg, .png, .ico)
- Document (.doc, .docx, .pdf, .ps, .text, .txt)
- Presentation (.ppt)
- Spreadsheet (.xls)
- Archive (.zip, .gtar, .gz, .tar, .jar)
- Media (.avi, .mov, .mpeg, .mpg, .qt, .ra, .swf, .wav)
Important: Users cannot include JavaScript in any managed files that are uploaded
for the store, for example, CSS files.
Procedure
-
Open the HCL Commerce configuration file (wc-server.xml), and locate the command element
for the
AttachmentUploadcommand.<Command maxuploadsize="10485760" name="AttachmentUpload" supportedFileExtension="doc,docx,xls,ppt,ra,rpm,gz,pdf,ps,swf,zip,gtar,tar,wav,gif,jpe,jpg,jpeg,text,txt,mpg,mpeg,mov,avi,qt,jar,png" uploadReturnURL_enabled="true" viruscheck="no" /> -
Open and update the HCL Commerce configuration file (wc-server.xml) file to include
mimetypefor .docx.<MimeType display="false" extension=".docx" type="application/msword"/> -
Open and update the ManagedFilePrimaryObjectDefinition.xml file to
include
mimetypefor .docx as one of the document types filter.<FileTypes description="${attachmentResources.fileTypesDescription_documents}" extension=".doc;.docx;.pdf;.ps;.text;.txt" name="documentTypesFilter"/>