Fixed upload bug for multilevel directory structures