How to upload mutiple files by FTP task in SSIS
I like to upload multiple files, with different names, in 开发者_StackOverflow社区a single FTP task to server in SSIS package. I am only able to upload one file.
the file names are also different e.g
xyz, zbc, ced
is there any way to upload multiple file in a FTP task in SSIS.
Thanks
just stumbled upon this and it was exactly what I was looking for. to elaborate on Faiz's answer:
- create the Foreach Loop Container
- edit "Collection" in the Foreach Loop Container
- set the "Enumerator" to "Foreach File Enumerator"
- select the Folder you want to check in
- set "Files" to "." or whatever wildcard filter you'd like
- select "Fully qualified" as the "Retrieve file name"
- click "Variable Mappings" and create a variable named whatever you'd like
- drop an "FTP Task" inside of the container
- create an "FtpConnection"
- click "File Transfer" and set "IsLocalPathVariable" to "True"
- select your new variable under "LocalVariable"
- set "Operation" to "Send Files"
- set whatever remote parameters you'd like
That's it! The variable will automatically update itself with the full path+name of each file found, and then upload it.
Put all the files in the same folder. Use FTP task inside a ForEachLoop and update the connection string using an expression updated by the loop container. That will do the trick.
精彩评论