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
Medium Priority
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 = ftp.networks.com, username: user1, pwd: 123, the folder path:
Thanks script-task.txt script-task.txt
Question by:sqlcurious
LVL 35

Accepted Solution

David Todd earned 2000 total points
ID: 37041777

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

ID: 37292930

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

864 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