The form you have been using sends text to the server.  You can also use forms to send files.  Files are strings of zeros and ones.  Those zeros and ones can be represented by text characters.  Therefore text can be used to represent files allowing forms to send files.  HTML therefore gives you an input type which handles files.

Open forms.html and save it as formfiles.html.  You need to tell the form how to encode the file as symbols so add this attribute to the opening form tag (just after the method="post" attribute would be good):


Delete all the elements inside the form element apart from the submit button.  Save and view and you should see just the submit button.  Change the text value for that button to Send this file.  Paste this code just before the submit button but inside the form:

<input type="file"  name="hello">

Save and view.  Select a file by browsing and when you press the button it will be uploaded to the server.  You should see details about the file reported back by the page which is currently handling the form for you (the action).  It should say something like this:

    [hello] => Array
            [name] => tiled.png
            [type] => image/png
            [tmp_name] => /customers/c/c/e/
            [error] => 0
            [size] => 632527


However, the file will then not be used as that page does not handle files.  You will learn to do that later using PHP.