.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unsupported Media Type errors found in logs when importing apps into newer version of Qlik Sense
Feb 17, 2022 8:42:58 AM
Dec 5, 2018 10:32:35 AM
An App exported from an older version of Qlik Sense now gives errors when importing into a newer version. C:\ProgramData\Qlik\Sense\Log\Repository\System, shows an "/qrs/app/upload Import app 500 Unsupported Media Type [415]:Unsupported Media Type()" error.
This issue can be related to a certain file type within the .QVF no longer being on the allowlist that Qlik Sense checks when importing apps. The following steps will detail how to modify this allow list using PGAdmin and Postman (or similar REST client).
Environment:
Occasionally, the File Extension Allow is updated between versions.
Resolution:
Option 1:
Open the App in an equal Qlik Sense Desktop version, save the app without changing anything , then try to import it again.
Option 2:
Using PowerShell, run this request to find the default library and what file extension types are accepted:
1. GET /QRS/fileextensionwhitelist/full?filter=(libraryType eq 1 and isDefault eq true)
$hdrs = @{} $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB") $hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator") $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'} $url = "https://qlikserver2.domain.local:4242/qrs/fileextensionwhitelist/full?filter=(libraryType eq 1 and isDefault eq true)&xrfkey=iX83QmNlvu87yyAB" Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -ContentType 'application/json' -Certificate $cert | ConvertTo-Json -Depth 10
Example of response:
{
"value": [
{
"id": "4e0b802b-2b76-4017-9120-7ec31027954f",
"createdDate": "2018-06-24T09:52:44.857Z",
"modifiedDate": "2018-06-24T09:52:44.857Z",
"modifiedByUserName": "INTERNAL\\bootstrap",
"libraryType": 1,
"isDefault": true,
"modifiedByCustomer": false,
"fileExtensions": [
{
"id": "37b5dee9-19fb-4614-8a09-b5bd4df1d1f1",
"name": "kml",
"privileges": null
},
{
"id": "81e5446d-53ad-49bb-8fc2-65089bad408b",
"name": "xls",
"privileges": null
},
{
"id": "f68eb7cd-8c06-4b78-8c5b-0d6d4fa5c395",
"name": "xlw",
"privileges": null
},
...
{
"id": "0b90af5a-8fba-46ef-9e6d-6ad80525ad14",
"name": "skv",
"privileges": null
},
{
"id": "1c92b170-51e0-4d5b-b4a4-5af7f70535cd",
"name": "fix",
"privileges": null
},
{
"id": "4d279dd2-f403-4df1-bd6a-331bdf872122",
"name": "prn",
"privileges": null
}
],
"privileges": null,
"schemaPath": "FileExtensionWhiteList"
}
],
"Count": 1
}
Run this request to find the list of possible file extension types:
2. GET /QRS/fileextension
$hdrs = @{} $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB") $hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator") $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'} $url = "https://qlikserver2.domain.local:4242/qrs/fileextension?xrfkey=iX83QmNlvu87yyAB" $resp = Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -ContentType 'application/json' -Certificate $cert foreach($i in $resp){ if($i.name -eq "png"){ $i | ConvertTo-Json -Depth 10 } }
Response example:
{ "id": "85c74338-59f5-43b8-b5ac-0a850613186e", "name": "png", "privileges": null }
Copy the JSON in step 1 and add the snippet in step 2 as below to be used as the BODY of the next request:
3. PUT /QRS/fileextensionwhitelist/<ID from earlier - step 1>
$body= '{ "value": [ { "id": "4e0b802b-2b76-4017-9120-7ec31027954f", "createdDate": "2018-06-24T09:52:44.857Z", "modifiedDate": "2018-06-24T09:52:44.857Z", "modifiedByUserName": "INTERNAL\\bootstrap", "libraryType": 1, "isDefault": true, "modifiedByCustomer": false, "fileExtensions": [ { "id": "37b5dee9-19fb-4614-8a09-b5bd4df1d1f1", "name": "kml", "privileges": null }, { "id": "85c74338-59f5-43b8-b5ac-0a850613186e", "name": "png", "privileges": null }, { "id": "81e5446d-53ad-49bb-8fc2-65089bad408b", "name": "xls", "privileges": null }, { "id": "f68eb7cd-8c06-4b78-8c5b-0d6d4fa5c395", "name": "xlw", "privileges": null }, ... { "id": "0b90af5a-8fba-46ef-9e6d-6ad80525ad14", "name": "skv", "privileges": null }, { "id": "1c92b170-51e0-4d5b-b4a4-5af7f70535cd", "name": "fix", "privileges": null }, { "id": "4d279dd2-f403-4df1-bd6a-331bdf872122", "name": "prn", "privileges": null } ], "privileges": null, "schemaPath": "FileExtensionWhiteList" } ], "Count": 1 }' $hdrs = @{} $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB") $hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator") $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'} $url = "https://qlikserver2.domain.local:4242/qrs/fileextensionwhitelist/4e0b802b-2b76-4017-9120-7ec31027954f?xrfkey=iX83QmNlvu87yyAB" Invoke-RestMethod -Uri $url -Method Put -Headers $hdrs -ContentType 'application/json' -Certificate $cert -Body $body
Try to import the QVF that was failing previously (multiple file extensions can be added at a time if needed)
This is also detailed in the help article: File extension allow list: Update