add upload and directory functions