Use HTML5 File Upload with Update Record Server Action

Use HTML5 File Upload with Update Record Server Action

Update file name in the database only when a file is uploaded

With this movie we will show you how to update the file name in the database, only when a file is uploaded when updating a record.

Step by Step

We will show you how to use HTML5 File Upload with the update record server action. Also you will learn, how to keep the file name in the database if no file is selected, when updating the record. In our previous tutorials, we've already explained how to update a database record. So we will skip the first steps in this video. We already created an update record form and imported its fields into the global variables, of our server action (1). We also setup our database connection. Now, let's add the file upload. Right click the database connection step (2). And under file management, add file upload (3).

Select your upload field (1). Under globals, post Click the file upload field. And then click the select button (2).

Select your upload path.

And right click the file upload step. Then, add database update. Click the update options button (1). Select the table, you want to update (2). And add it (3). And then add the columns, you'd like to update to the selected columns list (4). Select the column, where you will insert the uploaded image name. And click the server data bindings button, to select the value which will be inserted (5).

Click the image name, under the file upload step. And then click the select button.

We will use the condition field to send the file name, only if a file is selected for upload. Click the dynamic data button.

And select the same as in the value field the name binding, under the file upload step (1). Then click the select button (2).

This way the file name in the database, will remain untouched if there is no file uploaded, when updating a record. finish the update record step and save your action file. And then setup your server action executor. That's how easy it is to keep the current file name in the database if no file is uploaded when updating records.

Extensions Covered

Comments

Be the first to write a comment

You must me logged in to write a comment.