[enh] Detect syntax error before uploading file