Added function for upload per directory. Code Clean up. double slash bug fix.