Uploading Files Using CGI and Perl | Search for a title, author or keyword | ||||||||
Uploading Files Using CGI and Perl By Matt Doyle. Would you like to give your visitors the ability to upload files to your site? You can let them contribute pictures, sounds and other binary files to your site. To build your own file upload script, you'll need the following: a copy of Perl running on the Web server and the Perl CGI library, CGI.pm, installed on your Web server. File upload works by using a special type of form field called "file", and a special type of form encoding called "multipart/form-data". At the Web server end, the software ( in our case, a CGI script ) interprets the form data that's sent from the browser, and extracts the file name and contents, along with the other form fields. Usually, the file is then saved to a directory on the server. Handling the data that the browser sends when it uploads a file ( a sequence of MIME Content-Disposition Header Fields ) is quite a complex process. Fortunately, the Perl CGI library, CGI.pm, does most of the dirty work for us!
|
|||||||||
Uploading Files Using CGI and Perl | Disclaimer: this link points to content provided by other sites. |