且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在webapi上传中获取Multipart文件的流?

更新时间:2023-02-23 22:20:15

这与我几个月前遇到的困境相同(在MultipartStreamProvider接管之前捕获上传流并将其自动神奇地保存到文件).建议是继承该类并重写方法……但这在我的情况下不起作用. :((我想将MultipartFileStreamProviderMultipartFormDataStreamProvider的功能都集成到一个MultipartStreamProvider中,而没有自动保存的部分.)

This is identical to a dilemma I had a few months ago (capturing the upload stream before the MultipartStreamProvider took over and auto-magically saved the stream to a file). The recommendation was to inherit that class and override the methods ... but that didn't work in my case. :( (I wanted the functionality of both the MultipartFileStreamProvider and MultipartFormDataStreamProvider rolled into one MultipartStreamProvider, without the autosave part).

这可能会有所帮助; 这是由一位Web API开发人员

This might help; here's one written by one of the Web API developers, and this from the same developer.