Hi, for the process we are automating, we need to display a document saved in the S3 bucket.
To do this we used:
1) an integration for downloading from the bucket to an Appian folder
2) a safelink with web API/ a documentDownloadLink to download/view it from the user.
Our requirement in terms of user experience would be to use a single click for both activities.
How can we handle our problem? Thank you for suggestions, Eleonora
Discussion posts and replies are publicly visible
You could try to create a web API in Appian which calls the S3 integration to download the file and then returns that file as the body. You might have to adjust some headers to tell the browser to download the file instead of trying to display it.
Thanks for your answer Stefan, it is the solution we are trying but we are having some problem with the configuration of the webAPI. These is what we have done till now: we actually need to execute the integration before, than the request of the webAPI open the last downloaded document (screenshot attached). Do you have suggestions to make the webAPI works properly to download and open the file simultaneously? Thank you, Eleonora
I do not understand what you do in the first 4 lines. That does not feel good.
But in general, this is what I would expect to do myself. What is the issue?
Yes, we agree the problem could be the firtss 4 lines, where we do the following:
1) The local!id variable stores the numeric id of the last document downloaded using the integration API in the folder specified by the constant (we use the parameter fv!result of the rule!gfdownlodmultiple() to select the document already downloaded)2) Local!pathArray is used to get a URL containing the name of the downloaded document.
Our issue is the following: the use of this code does not activate the integration, so it is still necessary to do 2 different clicks for the download of the document. How can configure the headers you were talking about to call the integration and use its result directly in the Web API? Thanks for the reply, Eleonora
So that integration already returns a document. I do not understand why you search for documents and all this indexing and splitting action.
Stackoverflow has some interesting reading about how to set headers: https://stackoverflow.com/questions/33074726/hows-file-downloaded-by-the-browser-over-http
And I would like to repeat my question! What is the issue? Pointing you browser to that API endpoint should make it show or download that image.
In general, when I have a tricky problem, I cut it into simpler pieces, solve each, and reassemble it. Try to make this work with a document that you uploaded to Appian, referenced by a constant. Once that works, replace it with the S3 call.
www.freecodecamp.org/.../how-to-think-like-a-programmer-lessons-in-problem-solving-d1d8bf1de7d2