Nextcloud PHP API (stable18)

Files

This class provides access to the internal filesystem abstraction layer. Use this class exlusively if you want to access files

Tags
since
5.0.0
deprecated
14.0.0

Table of Contents

buildNotExistingFileName()  : string
Adds a suffix to the name in case the file exists
getMimeType()  : string
Get the mimetype form a local file
getStorage()  : View
Gets the Storage for an app - creates the needed folder if they are not existent
rmdirr()  : bool
Recusive deletion of folders
searchByMime()  : array
Search for files by mimetype
streamCopy()  : int
Copy the contents of one stream to another

Methods

buildNotExistingFileName()

Adds a suffix to the name in case the file exists

public static buildNotExistingFileName(string $path, string $filename) : string
Parameters
$path : string
$filename : string
Tags
since
5.0.0
deprecated
14.0.0

use getNonExistingName of the OCP\Files\Folder object

Return values
string

getMimeType()

Get the mimetype form a local file

public static getMimeType(string $path) : string
Parameters
$path : string
Tags
since
5.0.0
deprecated
14.0.0
Return values
string

does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead

getStorage()

Gets the Storage for an app - creates the needed folder if they are not existent

public static getStorage(string $app) : View
Parameters
$app : string
Tags
since
5.0.0
deprecated
14.0.0

use IAppData instead

Return values
View

rmdirr()

Recusive deletion of folders

public static rmdirr(mixed $dir) : bool
Parameters
$dir : mixed
Tags
since
5.0.0
deprecated
14.0.0
Return values
bool

searchByMime()

Search for files by mimetype

public static searchByMime(string $mimetype) : array
Parameters
$mimetype : string
Tags
since
6.0.0
deprecated
14.0.0
Return values
array

streamCopy()

Copy the contents of one stream to another

public static streamCopy(resource $source, resource $target) : int
Parameters
$source : resource
$target : resource
Tags
since
5.0.0
deprecated
14.0.0
Return values
int

the number of bytes copied

Search results