admin管理员组文章数量:1189387
We have a web service that does some cloud file manipulation. I can upload and copy files with HTTP PUT requests using clients such as Chrome and Windows Explorer. (We support WebDAV.) I can not upload a local file using Postman, although I can upload text into a file.
I've followed the advice from this question to create the following set up:
When I run the test, my web service receives the request. When I examine the request processing in the debugger, our code finds no content when it tries to read data from the request, so our code creates a file of 0 bytes. When I look at the Postman console, it looks as though the local file I specified to be uploaded isn't being found by Postman ("File: undefined"), even though I specified the file using the Postman UI. How can I get Postman to transmit the file?
UPDATE:
If I follow @steadweb's answer from the same question and disable the Content-Type
header, I do get the text from the file, but I also get superfluous content. See below. The bold text below was from the original file that was uploaded. The plain text was not.
----------------------------841412509785409880235814 Content-Disposition: form-data; name="File"; filename="uploadedFileFromC.txt" Content-Type: text/plain
This file was uploaded from the local C drive.
----------------------------841412509785409880235814 Content-Disposition: form-data; name="_method"
PUT ----------------------------841412509785409880235814--
In this case too, the Postman console shows "File: undefined", so that information doesn't seem too useful.
本文标签: httpPostman won39t upload local file using PUTStack Overflow
版权声明:本文标题:http - Postman won't upload local file using PUT - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738400066a2084726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论