Added directory support for uploads.