script task to find if file exisits on a FTP site and then if it exists run the rest of the package

Posted on 2011-10-25
Last Modified: 2012-08-14
Hi experts,
I have found the attached code which sets the the 'Fileexists' user variable to true if a specified file exists on the FTP site, I understand that the I have to create a user variable Fileexists and then use it as a write variable in the script task , but I am new to c# coding, do would really help if you can look at the code and provide any corrections. I understand that I have to give the ftp credentials, folder name and file name in the C# code but I am not aware of the rest of the syntax.
Please help. For ex: the ftp site =, username: user1, pwd: 123, the folder path:
Thanks script-task.txt script-task.txt
Question by:sqlcurious
    LVL 35

    Accepted Solution


    What I did recently was to get all available files from ftps site using a 3rd party component, then in my directory process available files. Once processed, move files to processed subdirectory, and delete from ftps site.

    If there are no local files then those steps - as I'm using a for each file iterator - will be skipped


    Author Closing Comment


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now