Want your form to allow you to select a file from your computer? How can you do it?
NOF does not inherently have a form field for "file" types, so we have to insert the field as HTML
1) Create your form and place all your form fields in it. Then where you want the file to be uploaded, press CTRL-T to insert HTML
2) In the Insert HTML box, enter your field name, with TYPE='FILE'
then click OK
3) Make sure your form setting is set to accept files. Select Settings in the properties palette
Then make sure the method is "POST" and the Encoding type is set to multipart/form-data
When you publish the site, you will have a form field and "BROWSE" button that will allow you to select and upload a file.
NOTE: Once you have uploaded the file, you will still need to "process it" by placing it in the appropriate server directory. That is a function of the server and will require more work than is discussed here. How to handle the file will depend on what your intentions are with the file, the file type, any scripting language you are using (ColdFusion, ASP, JSP, PHP, etc), and the limitations placed on you by your hosting company.
Did you find this tutorial useful? Do you want to keep this resource online? Make a donation to keep gotFusion alive
|
|