Dave

Dave

  • NA
  • 9
  • 0

Accept file via HTTP form?

Apr 6 2010 11:16 AM

I have a C# CGI app that I have to modify so that it can accept file uploads from (company internal) web users.  The app currently only expects 'regular' form data (ie, text name/value pairs).Can anyone point me to something that tells how to handle the file contents? 
I've got the HTML form set up as a POST with 'enctype="multipart/form-data"', but I don't know how to handle the multipart form content on the server side.  Currently, the app just uses 'Console.In.ReadToEnd()' to get the form contents and then splits the resulting string on '&' to get each name/value pair, and then splits those on '=' to get each name and value.  Obvisouly, that doesn't work for multipart/form-data.
Any suggestions?  And no, rewriting the app in ASP.NET is not an option currently.  :)
          Dave