Jump to content
  • 0

Use File upload as a link in a Case Statement


Hiperf

Question

Thank you in advance for your help.

I have two upload locations. The first one is the Caspio upload to the Caspio file section. My users are uploading very large scanned files (PDFs), and I had to create a separate upload page outside of Caspio and outside storage. However, I have a tabular data page that shows the upload link. I need to create a CASE statement that will determine if the old document upload ( [@field:ISDocumentUpload])was used; if not, then the new URL ([@field:ISFileURL]). This is what I have so far, but I am having problems getting the URL of the Capsio upload location.

CASE
WHEN [@field:ISDocumentUpload] IS NOT NULL
THEN '<a href="@FileUploadField">Download File</a>'
ELSE '[@field:ISFileURL]'
END

 

So far the <a href="@FileUploadField">Download File</a> only shows a link that changes when you hover, but there is no destination URL inserted.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @Hiperf

Could you specify what your intention is by adding @FileUploadField? The syntax does not seem right because when referring to a field from the table, it should be [@field:FileUploadField]

What is the field name of the native file field? Is it ISDocumentUpload or FileUploadField?

 To create a link to the file from the file field, first, you need to enable filestore CDN: https://howto.caspio.com/files-and-images/filestor-cdn/

After that, you can get a URL to the file using the specified in the article structure.

Link to comment
Share on other sites

  • 0

I have two different upload locations; the old one is through Caspio using the File Field, and the new upload location is to our server. I need to keep the old one active for 14 months so the users can click a link on the record and download the file. I am trying to display only one column for the download link; see attached.

Screenshot 2024-02-05 171031.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...