Inserting Uploaded File Names in a Database

Storing the uploaded file name in your database is an easy task in Server Connect.
You already know HOW TO UPLOAD A FILE so this will be just an addition to it, showing how to store the uploaded file name in your database.

You already have your upload page, with the upload server action set up. Now we will just extend the existing server action. Open the server connect panel:

Right click the file upload step:

Open the Database Actions menu and select Database Connection:

Setup your database connection or select one if you already defined it. Then right click the database connection step:

Open the database actions menu and select Database Insert:

Then click the Insert Options button:

Select the table where you want to store your file info:

Double click the value field, for the column you want to insert the file info into. Then click the dynamic data picker:

You can either store just the file name (1) or the file URL (2).
Storing the file name only, will require to manually add the path to the file on the pages where you are going to use this info and use a dynamic value for the file.
Storing the URL will allow you to bind the whole url to the file on your pages.

It’s up to you to decide which one to store:

We prefer to store just the file name, as it’s a more flexible solution:

Click OK:

Save your server action:

And you are done.


WapplerPrevious   WapplerNext


2 Likes

Hi Teodor,

Firstly, thank you for providing these very useful file upload tutorials. I have also added a table on the same page which lists the uploaded files and provides the download links. However, I have not found a way to auto refresh the table after the file has been uploaded. Is there some kind of auto refresh option?

Thanks and best regards,
Brian

Hi Brian,
On success of the upload action, reload the server action listing the files :slight_smile:

Of course - now that you say it like that - seems obvious. Thanks again! :smile:

1 Like

7 posts were split to a new topic: Can’t see upload step properties on insert