How do I link uploaded files so a click can open the file

Hello Team Wappler,
I am trying to create a simple file Upload , Listing and reading system with the following uses;

  1. User Logs in to see a list of files (pdfs mainly).
  2. User clicks on File Name to open the file.
    2a. I want this file to open in a document viewer so it is not readily downloadable.

THINGS COMPLETED:

  1. I have done the login system by following the tutorials.
  2. Done the file uploading page which works fine with progress bar.
  3. File name is inserted in DB also and added to extra fields for Document Title and Type.
  4. I have a page (file_list.php) which displays the list of uploaded files using FOLDER LIST Server Connect.
    This is where I get stuck.

TO BE DONE:

  1. How do I hyperlink the file names displayed on step 4 above so that they open the exact pdf file.
  2. If the above works, I would then like to extend this by making the file open inside a document viewer instead.
    Is this the right approach for this, Would it be better to rather display records from the DB instead of FOLDER LIST? Then back to my main question how do I link the file names to be able to open them.
    I am stuck and any help is greatly appreciated.

ScreenShots below
Login Page


File Upload Page

File list Page

Hello @enyonam
When you generate the data table, make sure to change the binding type to inner for the column you want to make clickable. This will add the binding like <td>{{name}}</td> instead of like an attribute as it adds it by default <td dmx-text="name"></td>.
This way you will be able to select your binding/text on the page:

Then on the page, double click the table cell and select the text. Click the make link button:

Now your text is wrapped within <a> tags.

So, you need to add the dynamic link to it. Select the <a> tag and add new dynamic attribute:

Select Link:

And then select a dynamic value for the link:

This should be the URL returned by the folder list data source:

I also suggest going through the basics of using the dynamic attributes:

2 Likes

A million Thanks @Teodor I have been able to do it. See Screenshot Below

However, I will like to use more friendly Document Names instead of the file names. On the file upload form, I have a Text input field for Document Titles which gets inserted into the DB. How do I get this Document Title in the table rather than the file name it self.

You will need to query your database table then, and create the data table on the page out of it. The folder list just lists your files as they are.
You will need to store the file name/url in the database as well.

From the file upload page, i am able to store the File Name(Document Tile) in the db. Question is how do I store the URL. Steps for that will be great.

take a look at webinar 5b, it is all explained at the start of that