Actions

API16

JStream/upload

From Joomla! Documentation

< API16:JStream
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Upload a file

[Edit Descripton]

Description:JStream/upload

Syntax

upload($src, $dest, $context=null, $use_prefix=true, $relative=false)
Parameter Name Default Value Description
$src
$dest
$context null
$use_prefix true
$relative false

Defined in

libraries/joomla/filesystem/stream.php

Importing

jimport( 'joomla.filesystem.stream' );

Source Body

function upload($src, $dest, $context=null, $use_prefix=true, $relative=false)
{
        if(is_uploaded_file($src)) { // make sure its an uploaded file
                return $this->copy($src, $dest, $context, $use_prefix, $relative);
        } else {
                $this->setError(JText::_('Not an uploaded file!'));
                return false;
        }
}

[Edit See Also] SeeAlso:JStream/upload

Examples

<CodeExamplesForm />