SSIS:File System Task 'Could not find file'

10,432

Solution 1

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.

Solution 2

In the file system task you must select variables containnig source filename and destination filename not folders.

Choose @[User::Filename] as source and choose the destination as another variable that contains the destination file path (not folder, must include file with extension)

You can generate destination value using script task or expression task. By concatenating the source filename (without path) + destination folder

Note that @[User::Filename] should be mapped in the Foreach Loop container

Share:
10,432
Vian Ojeda Garcia
Author by

Vian Ojeda Garcia

Updated on June 30, 2022

Comments

  • Vian Ojeda Garcia
    Vian Ojeda Garcia almost 2 years

    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