这是导致问题的行。请帮助!
dos.writeBytes("Content-Disposition: form-data;
name="uploaded_file";
"filename="""+ fileName + "" + lineEnd);
它在上载的文件名和文件名“)”和“;”中返回错误 还有这个 ”}”
请告诉我这段代码有什么问题吗?
SO上突出显示的语法已突出显示了该问题。您没有正确地对字符串中的字符进行转义:
dos.writeBytes("Content-Disposition: form-data; name="uploaded_file";"filename="""+ fileName + "" + lineEnd);
如果希望在字符串中插入引号而不实际关闭字符串,则需要使用反斜杠对其进行转义。
dos.writeBytes("Content-Disposition: form-data; name=\"uploaded_file\";\"filename=\"\""+ fileName + "" + lineEnd);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句