server icon indicating copy to clipboard operation
server copied to clipboard

Getting the Created Item Type

Open ibr123 opened this issue 8 years ago • 1 comments

Hi, I'm following the code here to get the type file or folder that I have created, but it didn't work

<?php

$test3 = \OC\Files\Filesystem::is_dir('$path');
if($test3){
			$this->logbasic(sprintf("DIR WORKED"));
		
		} else {
			$this->logbasic(sprintf("DIR DIDNT"));
		}

but the code above keeps returning false, how the path should look like? since to example was written, any idea how to solve it? thanks

ibr123 avatar Feb 19 '18 16:02 ibr123

I was using the returned value of the function internal path, it turned out that the returned path has the word files and additional characters on the path, for example instead of /test/test2/folder the internal path is files\/test\/test2\/folder so internal path need formatting before it can actually be used

ibr123 avatar Feb 20 '18 11:02 ibr123