puts files to temporary directory, and then move to permanent one