Tuto WEBDEV 25

Part 3: Intranet site with data 121 Remark The Upload control includes: • a cell containing: • a Static control, • a Looper control used to display the characteristics of files to upload. • a button allowing the user to select the file to upload, • a button allowing the user to send the files to the server. We are now going to adapt the control code in order to manage the file upload in our site. ▶ To configure the Upload control: 1. Display the code of the "ADDING" Button control: select the control and press F2. 2. Different WLanguage events are associated with the Upload control. We are going to modify the event "Receiving the files uploaded" to copy the image to the site data directory. 3. Write the following code in the event "Receiving the files uploaded" (ignore compilation errors, we will correct them later): UploadCopyFile(MySelf, fDataDir(), ... UploadFileName(MySelf, False)) gsImagePath = fDataDir() + [fSep()] + ... UploadFileName(MySelf, False) IMG_Visual = gsImagePath Remark This code is using "...". These 3 dots are used to perform a line break in a code line. They are used here for layout purposes. In the code editor, you can delete them and use a single code line.

RkJQdWJsaXNoZXIy NDQ0OA==