0

I know how to retrieve a file with a specified name like this:

HttpGet httpGet = new HttpGet(siteUrl +
                "_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/Working%20Files/FolderName')/Files('"
                +workbookName+"')/$value");

but is there a way to retrieve it without the name? maybe by index? Ive checked the documentation on https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest but saw no other examples on how else to retrieve files

Martina Carter
  • 409
  • 5
  • 18

1 Answers1

0

Every file you upload into the Sharepoint will have the field Id mapped to it. This ID would be returned as part of the response whenever you create the file in the Sharepoint. This response would also return several links and fields related to the particular file you uploaded, in order to perform any operations on that file. Using these fields such as Id, E-Tag you should be able to form another request to get the file name. You can also find the request URL in the response you received after file creation.

Rajesh2389
  • 349
  • 2
  • 15