In this article, I will show how to upload a file to the server on button click and store the file name and its (unique) file id in a separate nuBuilder Text object.
Type: HTML
Label: Upload File
ID: upload_html
HTML: Add the code from input_type_file.htm.
The HTML object holds code which creates a file upload object and processes the file upload
Type: Input (Text)
Label: Filename
ID: file_name (e.g.)
Width: 150
Also create this column in your database table (in phpMyAdmin). Type: VARCHAR(100)
This object is used to store the filename that is returned by the PHP script.
Place the upload_file.php in the folder /libs/upload/
Edit the permitted file types allowed for the file upload. Change the upload directory ($uploaddir) if necessary.
Create a new folder with the name files in the folder /libs/upload/