HTTP_Upload
[ class tree: HTTP_Upload ] [ index: HTTP_Upload ] [ all elements ]

Class: HTTP_Upload

Source Location: /HTTP_Upload-1.0.0b4/HTTP/Upload.php

Class Overview

PEAR
   |
   --HTTP_Upload_Error
      |
      --HTTP_Upload

This class provides an advanced file uploader system for file uploads made from html forms


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTTP_Upload_Error

HTTP_Upload_Error::HTTP_Upload_Error()
PHP4 Constructor
HTTP_Upload_Error::__construct()
PHP5 Constructor
HTTP_Upload_Error::errorCode()
returns the error code
HTTP_Upload_Error::raiseError()
Overwrites the PEAR::raiseError method
HTTP_Upload_Error::_loadLanguage()
Loads language strings into error codes variable

Class Details

[line 52]
This class provides an advanced file uploader system for file uploads made from html forms


[ Top ]


Class Variables

$files = array()

[line 58]

Contains an array of "uploaded files" objects
  • Access: protected

Type:   array


[ Top ]

$is_built =  false

[line 64]

Whether the files array has already been built or not
  • Access: protected

Type:   int


[ Top ]

$_allowMultipleExtensions =  false

[line 89]

Whether or not to consider multiple extensions

e.g. file.txt.foo would have 'txt' and 'foo'

  • Access: protected

Type:   bool


[ Top ]

$_chmod =  HTTP_UPLOAD_DEFAULT_CHMOD

[line 70]

Contains the desired chmod for uploaded files
  • Access: protected

Type:   int


[ Top ]

$_modeNameSeq = array(
        'flag' => false,
        'prepend' => '',
        'append' => '',
    )

[line 78]

Specially used if the naming mode is 'seq' Contains file naming information
  • Access: protected

Type:   array


[ Top ]



Method Detail

HTTP_Upload (Constructor)   [line 121]

HTTP_Upload HTTP_Upload( [ $lang = null])

PHP4 Constructor

Parameters:

   $lang   — 

[ Top ]

__construct (Constructor)   [line 97]

HTTP_Upload __construct( [string $lang = null])

PHP5 Constructor
  • See: Upload_Error::error_codes
  • Access: public

Overrides HTTP_Upload_Error::__construct() (PHP5 Constructor)

Parameters:

string   $lang   —  Language to use for reporting errors

[ Top ]

allowMultipleFileExtensions   [line 131]

void allowMultipleFileExtensions( [string $flag = true])

Whether or not to consider multiple extensions

e.g. file.txt.foo would have 'txt' and 'foo'

  • Access: public

Parameters:

string   $flag   — 

[ Top ]

getFiles   [line 149]

mixed getFiles( [mixed $file = null])

Get files
  • Return: array or object (see @param $file above) or Pear_Error
  • Access: public

Parameters:

mixed   $file   —  If:
  • not given, function will return array of upload_file objects
  • is int, will return the $file position in upload_file objects array
  • is string, will return the upload_file object corresponding to $file name of the form. For ex: if form is <input type="file" name="userfile"> to get this file use: $upload->getFiles('userfile')

[ Top ]

isMissing   [line 280]

mixed isMissing( )

Checks if the user submited or not some file
  • Return: False when are files or PEAR_Error when no files
  • See: Read the note in the source code about this function
  • Access: public

[ Top ]

setChmod   [line 313]

void setChmod( int $mode)

Sets the chmod to be used for uploaded files
  • Access: public

Parameters:

int   $mode   —  Desired mode

[ Top ]

_buildFiles   [line 201]

array _buildFiles( )

Creates the list of the uploaded file
  • Return: of HTTP_Upload_File objects for every file
  • Access: protected

[ Top ]


Documentation generated on Wed, 18 Jan 2017 14:00:02 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.