SSIS:File System Task 'Could not find file'

Vian Ojeda Garcia picture Vian Ojeda Garcia · Jun 6, 2017 · Viewed 8.5k times · Source

I am working on a SSIS project that download a file via web and upload the data in sql server then after that move the downloaded file to another folder. Here is an image for a clearer picture

enter image description here

I have a variable: Source_Folder with a value:C:\Users\T-Aordiz\Documents\DumpDatas\Outbound Dump\Dump Success_Folder value: C:\Users\T-Aordiz\Documents\DumpDatas\Outbound Dump\Success

For Each Loop values Expressions:@[User::Source_Folder] , Variable Mappings: User::FileName(which is blank string)

and here is my file system task

enter image description here

However I encounter this error message

Error: 0xC002F304 at Success, File System Task: An error occurred with the following error message: "Could not find file 'C:\Users\T-Aordiz\Documents\DumpDatas\Outbound Dump\Dump'.". Task failed: Success

I tried changing the expression in File System Task but also encountered an error. Help me guys

Answer

Wendy picture Wendy · Jun 6, 2017

Source connection,

Option 1, When using Foreach File Enumerator - 'Retrieve file name', if you choose Fully Qualified, it will give you a complete path, it means @[User::Filename] includes folder and file name with extension. you can use this variable as source connection variable.

Option 2, When using Foreach File Enumerator - 'Retrieve file name', if you choose 'Name and Extension', it means you must create another variable FilenameFullpath, expression specified as @[User::Source_Folder] + "\" + @[User::Filename]. (you can always include "\" at the end of your declared folder.)

Destination connection,

You can just specify a folder, no necessary to include file name and extension.