NAME

HTTP::File - Routines to deal with HTML input type file.

SYNOPSIS (CGI.pm example)

savepage.html looks like this:

<H1>Upload a webpage</H1>

<FORM METHOD=POST ENCTYPE="multipart/form-data" action="/cgi-bin/webplugin/savepage.cgi">

<INPUT TYPE=file name=FILE_UPLOAD size=35>

<INPUT TYPE=submit NAME=Action VALUE="Upload Ahoy!">

</FORM>

savepage.cgi looks like this:

#!/usr/bin/perl

use CGI; use HTTP::File;

$cgi = new CGI;

$upload_path='/tmp';

$raw_file = $cgi->param('FILE_UPLOAD'); $basename = HTTP::File::upload($raw_file,$upload_path);

DESCRIPTION

HTTP::File is a module to facilitate file uploads from HTML file input.It detects the basename of the raw file across MacOS, Windows, and Unix/Linux platforms.

sub platform

Uses a subset of the functionality of HTTP::Headers::UserAgent to determine the type of machine that uploaded the file.

sub upload

Upload RAW_FILE to the local disk to a specified PATH, or to /tmp if PATH is not specified.

Returns the basename of the uploaded file;

AUTHOR

Terrence Brannon PrincePawn@Yahoo.COM