I have a web cam that can send an image via HTTP PUT to a web server. I'd like to process this in ASP.NET MVC, but it doesn't natively support PUT. Is there any way to trick it into treating the request as a POST? I'm looking to get the Request.Form and Request.Files properties populated.
Asked
Active
Viewed 368 times
3
-
The top answer by Arjan does not actually address the issue I'm asking about. I'm trying to get ASP.NET to populate the File and Form properties, which it does not do by default for PUTs. – Brian Vallelunga Oct 26 '11 at 15:57
3 Answers
3
ASP.NET MVC supports PUT requests by putting the HttpPut attribute on the action.
(In earlier versions you might need to use the AcceptVerbs attribute...)

Arjan Einbu
- 13,543
- 2
- 56
- 59
-
It supports PUT for routing actions, but does not populate the Request objects like it does for POST requests. – Brian Vallelunga Oct 24 '11 at 21:56
0
Are you sure it doesn't support HTTP Put? I see that it is listed within the HttpVerbs Enumeration: http://msdn.microsoft.com/en-us/library/system.web.mvc.httpverbs.aspx
All you should have to do is ensure that you have decorated your action appropriately.

Jesse
- 8,223
- 6
- 49
- 81
0
This does not appear to be possible. I've just used the Request.InputStream to read in a bitmap directly.

Brian Vallelunga
- 9,869
- 15
- 60
- 87