I am trying to upload a file to the server and I get a message "The file(s) uploading failed".
The reason for this is to improve security in the application, a whitelist of allowed file types and their content type, is included in the server. Whenever a file is uploaded, we check the file extension against the list of allowed files and then check the file content against pre-defined standards, to ensure the file is in the format indicated by the extension.
What you are attempting is the import of a file that is not in the exact format expected, so to prevent the application, upload is blocked. You can check the Content Type in the server logs, then a decision can be made as to whether you want to allow this type of content in the server.
The file whitelist is found in the "Administrator->File Extensions" menu. In the out of the box configuration, we include extensions and content type necessary for operation of the base configuration. If additional content types are required, you can enable them. For example, we support import of device message strings in an Excel format. It is possible that strings could be edited and saved in OpenOffice, but while this creates an "Excel compatible" file, importing against the base configuration will fail as although it is "compatible", it is not an Excel file. In this case, Administrators could choose to add the OpenOffice format to the list of allowed content type.
As this extra level of security has been added, files that you previously imported may be rejected by the server (as content checking now takes place). If this occurs, you can investigate which content is stored in the file by reviewing the server logs and add to the allowed file extension list.
Before adding new content types, you are responsible for ensuring that the content type is valid for use in the application and that the code could not be malicious. If, for example, you add new content type just because the system rejected your file, this removes the protection that the whitelist provides. You should validate the content in an external application before adding to the Swift MEAP server. |
If when uploading a file, you encounter the message "The file(s) uploading failed", please perform the following steps to identify why the upload failed:. You will need to check what the content is within the file you are uploading and whether that should be added to the "File Extensions" menu.
To check content type:
NOTE: Logs should be at debug level for troubleshooting. If necessary, you can set logging to "Debug", attempt the file upload and then switch the logs back to previous settings. We need to capture the upload attempt to identify the file content type. In this example, we will attempt to import an .xlsx device message string saved by OpenOffice (this is not a filetype added by default to the server).
Therefore, in the admin console, we would need to add content type "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" to the list of acceptible content for xlsx files. If this is done, the importing will succeed. |
To add a new file extension / content type to the console:
|
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|