PdcSharepoint.DownloadFile: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == DownloadFile(strItemId As String, strFileLocation As String) As Boolean == Description == Download the file in Sharepoint targetted by strItemId.<br> If uns..."
 
No edit summary
Line 18: Line 18:
Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("scriptLocation")
Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("scriptLocation")
Dim resultId As String = sp.UploadFile("C:\files\test.txt")
Dim resultId As String = sp.UploadFile("C:\files\test.txt")
sp.DownloadFile(resultId, "C:\files\testResult.txt")
</source>
</source>


== Availability ==
== Availability ==
Available since 2021R4
Available since 2021R4

Revision as of 12:57, 28 January 2022

Declaration

DownloadFile(strItemId As String, strFileLocation As String) As Boolean

Description

Download the file in Sharepoint targetted by strItemId.
If unsuccessful, PdcApplication.LastError will contain an error message

Note

IMPORTANT:
This function requires libeay32.dll and ssleay32.dll (both versions 1.0.2.21 or higher) to be present in the PDCWIN directory
This is important for TLS 1.2 support in the TIdHTTP component, which is required for the Sharepoint download URL

For downloading see: https://github.com/IndySockets/OpenSSL-Binaries
Do NOT choose win64!

Code example

Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("scriptLocation")
Dim resultId As String = sp.UploadFile("C:\files\test.txt")
sp.DownloadFile(resultId, "C:\files\testResult.txt")

Availability

Available since 2021R4