What type of issue is this?
Question
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Target SharePoint environment
SharePoint Online
What browser(s) / client(s) have you tested
Additional environment details
No response
Issue description
Hello,
I am building a solution generating folders and files structure including a validation if such a name exists in the parent folder.
I am using the /_api/web/getFolderByServerRelativePath call for folders validation. There is a way, how to check if folder exist without an 404 error returned (by selecting the Exists property:
GET <site>/_api/web/getFolderByServerRelativePath(decodedUrl='<folder_url>')?$select=Exists
(the same call without selected Exists property would return error)
However the similar approach does not work for files - it returns an error all the time. (tested with getFolderByServerRelativeUrl and getFileByServerRelativeUrl with same results)
- Is there another way, how to check if file exists without an error returned from the call?
- Do anyone know, why are those calls inconsistent?
Thanks
What type of issue is this?
Question
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Target SharePoint environment
SharePoint Online
What browser(s) / client(s) have you tested
Additional environment details
No response
Issue description
Hello,
I am building a solution generating folders and files structure including a validation if such a name exists in the parent folder.
I am using the
/_api/web/getFolderByServerRelativePathcall for folders validation. There is a way, how to check if folder exist without an 404 error returned (by selecting theExistsproperty:GET <site>/_api/web/getFolderByServerRelativePath(decodedUrl='<folder_url>')?$select=Exists(the same call without selected
Existsproperty would return error)However the similar approach does not work for files - it returns an error all the time. (tested with
getFolderByServerRelativeUrlandgetFileByServerRelativeUrlwith same results)Thanks