SSIS Create New Folders On The Fly When Writing To A Flat File Connection
You need to use a File System Task and set the Operation to Create Directory. Pass it a variable of the file path without the filename and it should create the directory.

See this blog article for a good example of creating folders from dynamic paths.