Forum Discussion
MarkShnier__You
Qrew Legend
3 years agoIt is a setting on your local computer as to how the browser handles file attachments. It may take some googling on your part, but for example if you click on a file attachment of type pdf, you may want to have your computer always open it up using Acrobat Reader. If you click a file of type xlsx, then you may want your computer to always open that with Excel.
On my Mac running Chrome, when I right click on the downloaded file in the footer area of my Chrome, it gives me a choice as to what to "always"s do with that file type.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
On my Mac running Chrome, when I right click on the downloaded file in the footer area of my Chrome, it gives me a choice as to what to "always"s do with that file type.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
MrunaliKadam
3 years agoQrew Trainee
Thank you Mark! I'll do research around. On my windows laptop, when I right click on the attachment name and select open link in new tab/window then it still asks to download instead of just opening in new tab.
------------------------------
Mrunali Kadam
------------------------------
------------------------------
Mrunali Kadam
------------------------------
- EdwardHefter3 years agoQrew CadetDue to security settings that QB has, some files can't be viewed directly in the browser and need to be downloaded first (even if they are downloaded and then opened right away in the system viewer) regardless of browser or browser setting.
I went round and round with them a few years ago when they took away the ability to view a PDF in the browser the way that most other websites (anyone with a statement like banks, DocuSign, etc.) will allow. They said there was a security concern in allowing it to open in the browser but didn't explain what the issue was. I'd love for them to change it back, because I hate having a bunch of files on computer I don't need.
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------- MarkShnier__You3 years ago
Qrew Legend
In the Kirk Trachy Magic Buttons app in the exchange there is a a demonstration of a technique which allow for the preview on a form of most typical attachment types, so the Microsoft ones like Excel, Word and also PDFs.
You create a report link field with a formula field of this below configured on the left and the right fields on the report link setting.
If([Attachment Type (formula)]="File",
URLRoot()&"db/"&AppID()&"?a=dbpage&pagename=iframe.html\n&rid="&[Record ID#]
&"&tabledbid="&Dbid()
&"&myurlroot="&URLRoot()
&"&fileattachmentfid=36")
// This field refers to iframe.html that is located in the pages section of this app. You will need to copy that code page into your app.
// You will also have to copy the code from this button and update it for your button to reflect what your file attachment's field id (fid) is. In this example the file attachment is 36. Yours may be different.
// Also be sure to "Allow open access Allow access to this file attachment from a Quickbase link without signing in". Edit the file attachment field properties and check the checkbox. Gview needs to be able to see the file in order to render it.
Then, you need a Page called iframe.html with this code.
<html>
<head><title></title></head>
<body>
<iframe id="kirk" style="height:100%;width:100%;border:none;overflow: scroll;"></iframe>
<script>
const urlParams = new URLSearchParams(window.location.search);
const rid = urlParams.get('rid');
const tabledbid = urlParams.get('tabledbid');
const myurlroot = urlParams.get('myurlroot');
const fileattachmentfid = urlParams.get('fileattachmentfid');
const src = "https://docs.google.com/gview?url=" + myurlroot + "/up/" + tabledbid + "/a/r" + rid + "/e" + fileattachmentfid + "/v0&embedded=true";
document.getElementById("kirk").src = src
</script>
</body>
</html>
The formula for [Attachment Type (formula)] is this.
var text Suffix = Right([Receipt Photo or Attachment],".");
var text NonPhotoFileType =
Case($Suffix,
"xls", "File",
"xlsx", "File",
"pdf", "File",
"doc", "File",
"docx", "File",
"ppt", "File",
"pptx", "File");
Note that this preview does not work on images. So you would have a Dynamic Form Rule to hide the google preview and show the jpg image normally if that is the attachment type.
Also note that you are essentially giving a Google access to your file attachments and relying on their good graces to maintain this free service. With a free Google service you never know when in the future they may turn off the service given that there is no advertising payment model to support it's cost. But then if this free service died, one might hope that an outfit like Juiced Technologies or maybe even Quickbase themselves would step in to offer a replacement.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- KeithJusas3 years agoQrew CaptainMark, thank you as always for the reference...
We can certainly offer a pdf viewer as an add-on. The other file types are a bit of a challenge though but pdf viewer would not be a big challenge.
------------------------------
Keith Jusas
------------------------------