First, the js-api is working fine. I can authorize and connect to Activiti either via credentials or via ticket.
I am trying to open an attachment from a task. I know the js-api provides some function for that purpose.
Basically, I see two possibilities:
I download the content of the file through the js-api and then trying to view it “manually”
I provide the direct url (raw url) to the attachment and by clicking on that link the attachment will be opened.
I tried both and both ways have some problems.
When I am going to download the content it’s an asynchronous action. This means, when I am trying to open a new tab after the content has been downloaded, the browser will always recognize this new tab/window as pop up and blocks it. This is not specifically related to the Activiti URL, but to the fact that the download is asynchronous. So, I think it’s not a very good solution. Maybe for desktops it’s easier to make an exception for that URL for the whole landscape, but on mobile end devices it’s quite harder.
Then, I tried to provide the raw URL through a hyperlink. Whenever the end user clicks on it the action is synchronous and the browser does not detect this behavior as pop up. Unfortunately, I am not able to pass the credentials to this request. This is NOT done via the js-api.
And that’s basically my question. Is there any possibility to authorize to Activiti through a hyperlink whether via credentials or via ticket?
I tried to find a solution for that by calling the URL with an REST client. I passed the credentials to the request, but it is not working.
Can anybody explain how to properly display an attachment?
I can generate such a url and show the hyperlink to the user. Then, the problem is, that the request is not authorized.
This is exactly the solution I've described with point 2 in my initial post. Maybe I do not get your suggestion at this point. When calling this URL with a REST client a HTTP401 is returned even when the Basic Auth is set.
Other requests like tasks/query are working fine this way.