O'Reilly logo

Perl and Apache: Your visual blueprint for developing dynamic Web content by Adam McDaniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. CREATING DYNAMIC IMAGES WITH PERL

Accept a File for Upload

By allowing your users to upload files, you can expand the types of services that your Web site offers by writing a Perl CGI script that accepts the uploaded data, processes it, and produces some sort of result. To allow users to upload files, you must first create an HTML form that prompts the user for the file to upload, and then create a Perl CGI script that accepts the upload using the CGI library.

To accept files, your opening HTML form tag must specify a special encoding-type attribute called "multipart/form-data", after which, all data fields that are sent will be specially formatted for complex data payloads. This allows you to accept relatively large files, and to maintain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required