[owncloud-devel] API function to get data directory

Robin Appelman robin at icewind.nl
Thu Apr 21 17:43:11 GMT 2016


On Thursday, 21 April 2016 14:33:50 CEST Mathieu Fourcroy wrote:
> $path = '/var/www/owncloud/data/' . $user->getDisplayName() . '/files/' .
> $fileName;

Not all setups have their user directories in the data/user/files format, to 
get the data location while taking those setups into account you'll want to 
use

$userManager = \OC::$server->getUserManager();
$path = $userManager->get($user)->getHome() . '/files/....';

Also take into account that not all files are stored locally

 - Robin Appelman


More information about the Devel mailing list