单阶段上传文件request的contentType为什么是null?

阅读次数 44

FileUploadSinglePhase.Request(fileId=d4cf161d_b4e2_41c2_bf75_bb93e07ea2f4, file=org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile@7c167335, name=1-7.doc, size=12800, sha1=8a1e7419b5bfb58bfb6c3d0781e72bb194896caf, isManual=false, attachmentSize=0, contentType=null)

3 Answers

你好,你看的是body中的参数。request 的content-type从header中拿。 image.png

我是想知道文件mimetype,像调试接口一样,文档里说form里面有(看下面的截图),结果又是null,这是bug吧,需要fix

OK,我们记录一下,将安排研发跟进,文档的mime type是个固定值。 比如你打开的是doc文件,那么mimetype就是application/msword,如果是docx文件,那么就是application/vnd.openxmlformats-officedocument.wordprocessingml.document