我正在使用https://github.com/nervgh/angular-file-upload上传我的文件。
但是,我看到上传体是这样的-
------WebKitFormBoundaryXjCfky7muJb4rrZu
Content-Disposition: form-data; name="file"; filename="dump.rdb"
Content-Type: application/octet-stream
------WebKitFormBoundaryXjCfky7muJb4rrZu--这使得请求大小(Content-Length头)大于文件大小。我的服务器需要fileSize作为头,但也需要它与请求主体大小相同。我怎么也能-
a)告知angular- file -upload只发送body中的文件,不添加任何其他数据
b)如果a)不可能,则在上传之前获取Content_length头部
发布于 2018-03-05 11:17:19
我在fileItem上设置了这个,修复了它-
disableMultipart: true在angular-file-upload https://github.com/nervgh/angular-file-upload/pull/602上的PR中包含了它
https://stackoverflow.com/questions/49102592
复制相似问题