Download files from SharePoint Library

Hi, I was looking around the Forum and Google to find the right node to download files uploaded in SharePoint library. My company is using SSO authentication which I was able to use HTTPS Connection to connect to the SharePoint. But I can’t download any files from the SharePoint library. I also used the Download note but to no avail. It created a file in my destination folder with no content. Appreciate someone could advise a solution. Thank you

Hi there!

So the Download node executes and creates file you want to download from your SharePoint but it is a empty file? Have you tried only downloading one file or multiple files? The downloaded file opens without problems?

Br,
Ivan

Yes. I was able to authenticate with my corporate Sharepoint with the SSL certificate added to cacerts. I have indicated the source file with full path in the Download node. After executed, the file generated in my depository folder was a 1Kb file which I opened it as an empty file.

I only tried with one file.

Appreciate your reply Ivan

Hi there!

you are welcome. Can you try to download couple more files from different SharePoint locations and with different extensions just to check is it same for every file?

Additionally you can check KNIME log where maybe more information can be found.

Br,
Ivan

Hi Ivan,

I tried with a different SharePoint library and use a regular expression ([0-9][a-zA-Z0-9]) to download all files within the library but still show no results. I checked the log file and it shows that KNIME was able to navigate to the SharePoint library and identified 2 directories within the library. But KNIME did not download any files at all :frowning:

2019-04-25 19:47:20,946 : DEBUG : KNIME-Worker-11 : WorkflowDataRepository : Download : 3:3 : Adding handler 7bb66bdb-08da-4a9d-94c1-c4254cd9cb25 (Download 3:3: ) - 2 in total
2019-04-25 19:47:20,946 : DEBUG : KNIME-Worker-11 : LocalNodeExecutionJob : Download : 3:3 : Download 3:3 Start execute
2019-04-25 19:47:20,958 : DEBUG : KNIME-Worker-11 : Buffer : Download : 3:3 : Using table format org.knime.core.data.container.DefaultTableStoreFormat
2019-04-25 19:47:20,958 : INFO : KNIME-Worker-11 : DownloadNodeModel : Download : 3:3 : The result table at port 0 contains no rows
2019-04-25 19:47:20,959 : WARN : KNIME-Worker-11 : Node : Download : 3:3 : Node created an empty data table.
2019-04-25 19:47:20,962 : INFO : KNIME-Worker-11 : LocalNodeExecutionJob : Download : 3:3 : Download 3:3 End execute (0 secs)
2019-04-25 19:47:20,962 : DEBUG : KNIME-Worker-11 : WorkflowManager : Download : 3:3 : Download 3:3 doBeforePostExecution
2019-04-25 19:47:20,962 : DEBUG : KNIME-Worker-11 : NodeContainer : Download : 3:3 : Download 3:3 has new state: POSTEXECUTE
2019-04-25 19:47:20,962 : DEBUG : KNIME-Worker-11 : WorkflowManager : Download : 3:3 : Download 3:3 doAfterExecute - success
2019-04-25 19:47:20,962 : DEBUG : KNIME-Worker-11 : NodeContainer : Download : 3:3 : Download 3:3 has new state: EXECUTED
2019-04-25 19:47:20,972 : DEBUG : KNIME-Worker-11 : NodeContainer : Download : 3:3 : APAC_Application 3 has new state: IDLE
2019-04-25 19:47:20,972 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer : : : ROOT has new state: IDLE

Unfortunately, I am not able to upload my KNIME workflow in the corporate environment due to data loss prevention controls. But the workflow is very simple i.e. HTTPS Connection -> Download

Thank you very much Ivan for your kind advice.

Hi there!

Have you come to the bottom of this?

From logs it start downloading but then got an empty table. Maybe there is something on SharePoint side preventing KNIME… Try checking what happens on SharePoint when you try to download file from it from KNIME.

Additionally have you tried Web Service or REST approach for accessing SharePoint?
Here is a link: Accessing files through Sharepoint

Br,
Ivan

2 Likes

Hello @wxchoy,

with KNIME version 4.2.0. there is now a dedicated connector to SharePoint!
You can find more about it here: https://www.knime.com/whats-new-in-knime-42#sharepoint

Br,
Ivan

1 Like