This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Library_FileImporter

Direct known subclasses

FileImporter

Package: Core
Category: Concrete
Copyright: Copyright (c) 2003-2009 Concrete5. (http://www.concrete5.org)
License: MIT License
Author: Andrew Embler andrew@concrete5.org
Located at core/libraries/file/importer.php

Methods summary

public
# getErrorMessage( $code )

Returns a text string explaining the error that was passed

protected
protected
# storeFile( $prefix, $pointer, $filename, $fr = false )
public number
# import( string $pointer, string $filename = false, FileRecord $fr = false )

Imports a local file into the system. The file must be added to this path somehow. That's what happens in tools/files/importers/. If a $fr (FileRecord) object is passed, we assign the newly imported FileVersion object to that File. If not, we make a new filerecord.

Constants summary

integer E_PHP_FILE_ERROR_DEFAULT

PHP error constants - these match those founds in $_FILES[$field]['error] if it exists

# 0
integer E_PHP_FILE_EXCEEDS_UPLOAD_MAX_FILESIZE
# 1
integer E_PHP_FILE_EXCEEDS_HTML_MAX_FILE_SIZE
# 2
integer E_PHP_FILE_PARTIAL_UPLOAD
# 3
integer E_PHP_NO_FILE
# 4
integer E_FILE_INVALID_EXTENSION

concrete5 internal error constants

# 10
integer E_FILE_INVALID
# 11
integer E_FILE_UNABLE_TO_STORE
# 12