Reworked directory createtion for attached files.