public static
string
|
#
getExt( string $file )
Gets the extension of a file name
Gets the extension of a file name
Parameters
- $file
string - $file The file name
Returns
string - The file extension
Since
11.1
|
public static
string
|
#
stripExt( string $file )
Strips the last extension off of a file name
Strips the last extension off of a file name
Parameters
- $file
string - $file The file name
Returns
string - The file name without the extension
Since
11.1
|
public static
string
|
#
makeSafe( string $file )
Makes file name safe to use
Makes file name safe to use
Parameters
- $file
string - $file The name of the file [not full path]
Returns
string - The sanitised string
Since
11.1
|
public static
boolean
|
#
copy( string $src, string $dest, string $path = null, boolean $use_streams = false )
Copies a file
Parameters
- $src
string - $src The path to the source file
- $dest
string - $dest The path to the destination file
- $path
string - $path An optional base path to prefix to the file names
- $use_streams
boolean - $use_streams True to use streams
Returns
boolean - True on success
Since
11.1
|
public static
boolean
|
#
delete( mixed $file )
Delete a file or array of files
Delete a file or array of files
Parameters
- $file
mixed - $file The file name or an array of file names
Returns
boolean - True on success
Since
11.1
|
public static
boolean
|
#
move( string $src, string $dest, string $path = '', boolean $use_streams = false )
Moves a file
Parameters
- $src
string - $src The path to the source file
- $dest
string - $dest The path to the destination file
- $path
string - $path An optional base path to prefix to the file names
- $use_streams
boolean - $use_streams True to use streams
Returns
boolean - True on success
Since
11.1
|
public static
mixed
|
#
read( string $filename, boolean $incpath = false, integer $amount = 0, integer $chunksize = 8192, integer $offset = 0 )
Read the contents of a file
Read the contents of a file
Deprecated
13.3 (Platform) & 4.0 (CMS) - Use the native file_get_contents() instead.
Parameters
- $filename
string - $filename The full file path
- $incpath
boolean - $incpath Use include path
- $amount
integer - $amount Amount of file to read
- $chunksize
integer - $chunksize Size of chunks to read
- $offset
integer - $offset Offset of the file
Returns
mixed - Returns file contents or boolean False if failed
Since
11.1
|
public static
boolean
|
#
write( string $file, string $buffer, boolean $use_streams = false )
Write contents to a file
Parameters
- $file
string - $file The full file path
- $buffer
string - $buffer The buffer to write
- $use_streams
boolean - $use_streams Use streams
Returns
boolean - True on success
Since
11.1
|
public static
boolean
|
#
append( string $file, string $buffer, boolean $use_streams = false )
Append contents to a file
Append contents to a file
Parameters
- $file
string - $file The full file path
- $buffer
string - $buffer The buffer to write
- $use_streams
boolean - $use_streams Use streams
Returns
boolean - True on success
Since
3.6.0
|
public static
boolean
|
#
upload( string $src, string $dest, boolean $use_streams = false, boolean $allow_unsafe = false, boolean $safeFileOptions = array() )
Moves an uploaded file to a destination folder
Moves an uploaded file to a destination folder
Parameters
- $src
string - $src The name of the php (temporary) uploaded file
- $dest
string - $dest The path (including filename) to move the uploaded file to
- $use_streams
boolean - $use_streams True to use streams
- $allow_unsafe
boolean - $allow_unsafe Allow the upload of unsafe files
- $safeFileOptions
boolean - $safeFileOptions Options to JFilterInput::isSafeFile
Returns
boolean - True on success
Since
11.1
|
public static
boolean
|
#
exists( string $file )
Wrapper for the standard file_exists function
Wrapper for the standard file_exists function
Parameters
- $file
string - $file File path
Returns
boolean - True if path is a file
Since
11.1
|
public static
string
|
#
getName( string $file )
Returns the name, without any path.
Returns the name, without any path.
Deprecated
13.3 (Platform) & 4.0 (CMS) - Use basename() instead.
Parameters
- $file
string - $file File path
Returns
string - filename
Since
11.1
|