Discuss

Inserting Uploaded File Names in a Database

On this page

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:

Screenshot_1|690x396

Right click the file upload step:

Screenshot_2|690x396

Open the Database Actions menu and select Database Connection:

Screenshot_3|690x396

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

Screenshot_4|690x396

Open the database actions menu and select Database Insert:

Screenshot_5|690x396

Then click the Insert Options button:

Screenshot_6|690x396

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

Screenshot_7|690x396

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

Screenshot_8|690x396

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: Screenshot_9|690x396

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

Screenshot_10|690x396

Click OK:

Screenshot_11|690x396

Save your server action:

Screenshot_12|690x396

And you are done.


WapplerPrevious|101x31   WapplerNext|77x31