Actions

API16

JStream/upload

< API16:JStream

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Upload a file



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;
        }
}



Examples

Code Examples


Advertisement