added jquery ajax in upload function