Optimization: check metadata before uploading data