• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. Forms > Allowing Visitors to Upload Files

Allowing Visitors to Upload Files

If the information you need from the folks filling out your form is complicated, you might want to have them upload an entire file to your server.

To allow visitors to upload files

1.
Type <form method=“post” action= “upload.cgi” where upload.cgi is the URL of a special CGI script that processes incoming files. Most regular form parsing scripts won’t be enough.

2.
Type enctype=“multipart/form-data”>. The enctype attribute ensures that the file is uploaded in the proper format.

3.
Type the caption for the file upload area so your visitors know what to do. Something like What file would you like to upload? would work well.

4.
Type <input type=“file” to create a file upload box and a Browse button.

5.
Type name=“title”, where title identifies to the server the files being uploaded.

6.
If desired, type size=“n”, where n is the width, in characters, of the field in which the visitor will enter the path and file name.

7.
Type the final />.

8.
Complete the form as usual, including the submit button and final </form> tag.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint