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..."
 
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
If unsuccessful, [[PdcApplication.LastError]] will contain an error message
If unsuccessful, [[PdcApplication.LastError]] will contain an error message


== Note ==
== Notes ==
IMPORTANT:<br>
IMPORTANT:<br>
This function requires libeay32.dll and ssleay32.dll (both versions 1.0.2.21 or higher) to be present in the PDCWIN directory<br>
This function requires libeay32.dll and ssleay32.dll (both versions 1.0.2.21 or higher) to be present in the PDCWIN directory<br>
Line 12: Line 12:
<br>
<br>
For downloading see: https://github.com/IndySockets/OpenSSL-Binaries <br>
For downloading see: https://github.com/IndySockets/OpenSSL-Binaries <br>
Do NOT choose win64!  
Do NOT choose win64!
 
== Code example ==
== Code example ==


Line 18: Line 19:
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

Latest revision as of 14:44, 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

Notes

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