Setting up your form for file upload

The basic tool for uploading files is a form element known as a file field. The file field consists of a standard text field and a Browse button. The Browse button is used to search the user's local drive to locate a file. When the desired file is selected, the path to the file appears on the associated text field. In Dreamweaver, the file field is located with the other form elements in the Forms category of the Insert bar.

To add a file field to your form:

  1. Open a PHP page with a basic form.
  2. Set your form action to the current page.

    Note: If you wish to display another page after the file has uploaded, you will need to use the Server Redirect function of Digital File Pro.
  3. Place your cursor in the space intended to hold the file field.
  4. From the Forms category of the Insert bar, choose the File field object.

  5. With the File field selected, enter an appropriate name, such as uploadFile, in the Properties inspector's Name field.
  6. Press Ctrl (Cmd) + S to save your page.