putFile: add missing subfolder related code