added localstorage to directories to save top directory as the current directory. Fixed uploads in rails controller for resource to actually save the file