SSIS - Copying files from Dropbox

  • Hi guys

    1-

    I'd like to perform a ForEachLoop in order to get a list of files from Dropbox and subsequently copy/move them somewhere else.

    In the Folder property of the ForEach Loop, I have put "https://www.dropbox.com/...." but when I run the Package it always says that the loop didn't return anything.

    When pasting the same link in Explorer, it takes me to the correct webpage with the Images.

    2-

    When I want to copy a file from the Dropbox to my local drive, I use a "File System Task" but I cannot put "https://www.dropbox.com/...jpg" as the source file.

    I must be doing something stupid. If someone has ever managed this, could you please provide me with some pointers.

    Cheers!

  • You cannot use URLs in the for each loop/file system task.

    You can use UNC paths (//servername/folder/), but not http paths.

    You'll need to use the HTTP connection manager and a script task.

    Downloading a file over HTTP the SSIS way

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Ok, thanks.

    I'll give it a go.

    I have done quite a lot of Scripts in C# so it shouldn't be to hard ... I hope.

    Cheers

  • I have finally solve my first problem!

    The solution is very easy in the end:

    WebClient wc = new WebClient();

    wc.DownloadFile(<dropbox file>, <destination file>);

    ... and that's it!!

    The dropbox file must be in the form of "http://www.dl.dropboxusercontent.com/sd/sadasd/...jpg" for example.

    The destination file can be "C:\\Temp\\...jpg"

    Now working on copying the file to S3 bucket. For that part I have had to download AWSSDK.dll and reference it in my solution. I have then added "using Amazon.S3" and "using Amazon.S3.Transfer".

    This should allow me to create a new connection to the bucket and transfer the file across.

  • Nice, glad you got it solved.

    Thanks for posting back the solution.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply