added rmdir(recursiveliy) and fixed a upload bug