[upload/download] fixed url pattern bug; improved file upload