3

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.

jrummell
  • 42,637
  • 17
  • 112
  • 171
Brian Vallelunga
  • 9,869
  • 15
  • 60
  • 87
  • 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 Answers3

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
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