You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To determine whether folder exists the following approach could be considered:
$nonExistentFolderUrl = "/sites/team/archive";
$folder = $ctx->getWeb()->getFolderByServerRelativeUrl($nonExistentFolderUrl)->select(["Exists"])->get()->executeQuery();
if(!$folder->getExists()){
print_r("Folder {$nonExistentFolderUrl} has not been found");
}
Note: explicitly specifying Exists property via select method does the trick here, this way SharePoint API will not complain with System.IO.FileNotFoundException exception.
Hi,
Having great fun with this API.
Is there a way of checking for existance of a folder in a parent please?
Tried getExists but no joy!
The text was updated successfully, but these errors were encountered: