Forum Discussion
Hi Cogres,
you wouldn´t believe how often I google for a specific Innovator topic just to figure out that I already asked or answered the same question some time ago .[emoticon:33306c418930400bac28808410f8ac8b]
In this case you are right with your linked forum topic. The use case is quite similar. But I don´t want to stream a file from an external location. I just want to access a file, that is already available in Innovators own file vault. So I don´t think it´s very efficient to use a REST connection just to access data that the user already can access.
This is my latest idea:
var fileId = document.thisItem.getProperty("native_file");
var fileDownloadUrl = aras.IomInnovator.getFileUrl(fileId , aras.Enums.UrlType.SecurityToken);
var request = new XMLHttpRequest();
request.open('GET', fileDownloadUrl, true);
request.send(null);
request.onreadystatechange = function () {
if (request.readyState === 4 && request.status === 200) {
var type = request.getResponseHeader('Content-Type');
if (type.indexOf("text") !== 1) {
alert(request.responseText);
}
}
};
In this sample I create a temporary file download link and then read the file content from the link. But I am not sure if this one is a recommended way to solve this task.
Would be happy if somebody knows a more straight and lean variant.
Hi Angela,
I see! I didn't mean it in an accusatory way whatsoever, just thought it was a little bit funny to find that you answered a very similar question a few years back :D.
If what was written in the blog post we talked about still holds true, there is no IOM way of doing what you want to do. So we either have to REST it up (which is a little weird to do from within an already active Aras session, I agree), or do something similar to what you have suggested.
Of course, I cannot really comment on the overall data security of doing it in either of those ways in your particular setup. But I cannot think of another clever way to do what you want to be doing either.
Cheers,
C
- AngelaIp6 years agoIdeator I
Hi Cogres,
At no time did I find your post accusatory - nobody was more surprised than me [emoticon:752f32bcc91d4a448db162742a877a4a].
I am also not sure about the security and performance aspect of my current solution. But in my use case this is not a big problem, cause the Method is mainly used for occasional data validation. It´s not a Method that is used on a daily basis by all users, so I think it should do the job.
Angela