HTTP_Upload

Easy and secure managment of files submitted via HTML forms.

Introduction

This package provides an advanced system for managing uploads of files via HTML <input type="file" /> fields. Features include:

Examples

In the following examples it is assumed that you are using an HTML form field <input type="file" name="f" /> in order to upload files.

Extensive information about uploaded files

HTTP_Upload provides extensive information about uploaded files via the getProp() method:

If no value for name is provided, then this method will return an array containing all available information about the uploaded file. Otherwise the information identified by the value of this parameter will be returned as a string.

Internationalized Error Messages

Another handy feature of HTTP_Upload is support for internationalized error messages. This means that if an error (like an invalid file upload) is detected, the programmer can choose in which the language the error messages should be returned by HTTP_Upload.

The first parameter of the constructor method for HTTP_Upload determines the language to be used. This is illustrated in the following example: