have an ftp site with multiple zip files that are setup per date such as:
I'm writing an ssis package to load a csv file that is in the zip files. what i'm having trouble with is downloading the zip file that is today's date as this package will run daily.
so i did the following
1. variable: zipFileName with a value of where i want to download it to: \\servername\share
2. placed a script task to generated the zip file name; readwritevariables: user:zipFileName
public void Main()
Dts.TaskResult = (int)ScriptResults.Success;
string mainVar = Dts.Variables["zipFileName"].Value.ToString(); //\\server\share\file20120911.zip set to given date year month day
DateTime time = DateTime.Now;
string format = "20120910"; //"yyyyMMdd";
mainVar = "file" + format + ".zip";
Dts.Variables["zipFileName"] = mainVar; //doesn't like this
will that set the variable name to my desired file name?
3. success then goes to the ftp task to download the respected new variable file name: say todays date it would be -- file20120911.zip
4. ftp task - under the file transfer i set the following:
operation receive files
the ftp task gives an error: variable zipFileName doesnt start with /
how do i get this to generate a file name by ymd format and set it up with the ftp task?