implement most of upload check