I have a User collection that has a smart field called file. This smart field recieves a signed url that points to an image or pdf in AWS-S3.
When this signed url points to an image, the behaviour is correct and the smart field shows me that image. But, when this signed url points to a pdf file the behaviour is the following:
When i click to the list view, appears a file icon on every row and when i click it, browser throws the “file downloading” --> ok, fine.
When i click on the summary view of a document, in that moment the browser throws the file downloading automatically. And when i cancell it, also the document can’t be previewed.
So, my expected behaviour is as when this url points to an image: When i click on the summary view, and this smart field contain a signed url pointing to an PDF file, the browser wouldn’t have to throw the “file downloading” and simply it’d have to show me correctly the pdf file preview in the smart field.
I already do this.
As i said, with an image is it working correctly and i see that image. Obviously, with the “File display widget” selected. But when this Smart Field recieves a signed url that points to a pdf file, the behaviour is different…
Can you please share your forest-schema part is relation with this topic?
Do you think it’s related to the “signed url” value?
Did you try with a simple link to a pdf?
On my side I do not reproduce the error: pdf is displayed inline in summary view. The url used was a simple one.
Please provide a not working url for you to have a try.
Thanks to your link, I reproduced the problem.
It seems we have an issue displaying inline files with this special kind of links, sorry for that.
I’ve just created a ticket in Forest to resolve it.
I already saw this issue before. But this is due to the link. You have to make sure your link is not a download link but a link to the file.
The link you just shared is downloading a file while it should just open a tab with the file
Okay, solved. The problem was related to the “Content-Type” that the CloudFront S3 was returning to me (octet). In the pdf files this header must be “application/pdf”. Now Forest behaviour is correct.