In our previous article, we saw how to connect to Office 365 API using SSIS PowerPack.
In this quick post, we will see how to upload a file to OneDrive using REST API Task.
If you have file more than 60MB then it is more complex and not supported by ZappySys PowerPack (You have to split file bytes in range but for less than 60 MB below method will work fine)
Uploading file less than 60MB
For files of more than 4 Mb but less than 60 MB, we need 3 steps (see below).
Step-1 : Create OAuth Connection Manager.
Step-2 : Create SSIS Variables.
Step-3 : Create 3 steps as below (Use ZS Rest API task , ZS Advanced File System Task ).
Step-4 : Save URL for Upload Session to variable.
Step-5 : Get File Size in Bytes and save to variable.
Step-6 : Use Upload URL to push file content in stream mode.
Uploading file less than 4 MB
For small file all it takes is just one call to below URL (change folder and file name)