Internet Explorer 11 users will notice an incompatibility when attempting to click the link of a file uploaded. Files will upload correctly, they are just not accessible to the user once uploaded. To work around this issue, a script can be added to the File Upload Component that fixes the link. In the component's settings, click the Conditional tab. In the Advanced section, add the following JavaScript. Code Block |
---|
language | js |
---|
title | IE11 File Upload FixScript |
---|
linenumbers | true |
---|
| if(data[component.key] && data[component.key].length > 0)
{
for(i=0;i<data[component.key].length;i++)
{
var badIndex = data[component.key][i].url.indexOf('undefined');
if(badIndex > -1)
{
var file = data[component.key][i].url.substring(badIndex+9, data[component.key][i].url.length);
data[component.key][i].url = Formio.getBaseUrl() + '/api/files' + file;
value = data[component.key][i].url;
}
}
}
show = true; |
|