Invalid File name

Within my SSIS Package I have a Foreach Loop Container which gets my variable @ClientFileName. Got this message...

Information: 0x0 at TF Secure FTP Task - Download Files from Client, ExecuteDownload: Downloading file FHCA_DPA_20150806.txt

My next task is to actually then download the file that was determined from my Foreach Loop Container and I got this message...

Error: 0x0 at TF Secure FTP Task - Download Files from Client, ExecuteTask Failed:: File not found : /FHCA_DPA_20150806.txt (code=2)

I have NO IDEA why...but it looks as though it is appending a "/" at the beginning of the file name.

So I decided to put in an Expression task to try and parse out that leading "/". And this is the syntax I have...

@[User::ClientFileName] = FINDSTRING(@[User::ClientFileName],"/",1) != 0 ? SUBSTRING(@[User::ClientFileName],2,LEN(@[User::ClientFileName])) : @[User::ClientFileName]

It is still failing me with message...

Error: 0x0 at TF Secure FTP Task - Download Files from Client, ExecuteTask Failed:: File not found : /FHCA_DPA_20150806.txt (code=2)

Can ANYONE help me out with this? Point me in the right direction...maybe shed some light as to your Knowledgebase as to why this might even be happening in the first place...

Thanks for your review and am hopeful for a solution.

September 2nd, 2015 12:15pm

Hi ItBobby,

According to the document FTP Task, we can read that:

The FTP task supports the ? and * wildcard characters in paths. This lets the task access multiple files. However, you can use wildcard characters only in the part of the path that specifies the file name. For example, C:\MyDirectory\*.txt is a valid path, but C:\*\MyText.txt is not.

So, when you use expression tobuild the variable ClientFileName, make sure the evaluated value of the expression conforms to the above rule. 

Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 2:53pm

How does your file list as passed to the ForEach relate to the directory structure in the FTP server? Would you expect it to be in the base directory of the FTP user? (The forward slash would suggest it is looking at the root directory).

Put a breakpoint on the FTP task and view what your variable actually has and if that doesn't give anything away, maybe try specify the full FTP path to the file

September 2nd, 2015 4:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics