Check if file exists in subfolder without using an exception

If you check the blog post in “Check if file exists in list/library without using an exception”
the method here is somewhat similar, with some few additional tricks

Here we need serverRelativeUrl variable

The key here is in the xmlQuery, we added Scope=’RecursiveAll’, which looks entirely in a library, but we will limit the search only to our location with

and {1} is the serverRelativeUrl

Leave a Reply

Your email address will not be published. Required fields are marked *