ODBC guide

Download a file


Downloads a file from a SharePoint document library to a local disk.

SELECT * FROM download_file_to_disk
    WITH(
   -- Drive (SharePoint Document Library)	
      DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMxxxxxxxxxxxxx'
   --Enter file path (on root or under subfolder)
   --,FileId='root:/dump.pdf:' --Path must end with colon
   --,FileId='root:/myfolder/dump.pdf:'
   --OR-- 
   --,FileId='01SUOJPKHXMPKD2UXXXXXXXXXXXXXXXXXX'
   
     , TargetFilePath='C:\temp\List.xlsx'
   --, FileOverwriteMode='FailIfExists' //change default overwrite mode from AlwaysOverwrite to FailIfExists
    )
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.