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:
Save your server action:
And you are done.