0

I've Googl-ed/SO'd to death and still nothing seems to work for me. Everything has submitted fine except for the file. I've tried so many things I don't even have the original code prior to trying to get this darn file to transmit. I've tried WebClient, HttpWebRequest, etc. Nothing. I must be missing something trivial. Thanks.

  1. What should I be using for a class? WebClient? HttpWebRequest?
  2. What method should I be using to upload values. (I don't really care about parsing a response.)
  3. How do I get the file into the request? From what I understand I should get the bytes and add them to the NameValueCollection of parameters I already have?

        if (File.Exists(filepath))
            using (var ms = new MemoryStream())
            {
                new FileStream(filepath, FileMode.Open, FileAccess.Read).CopyTo(ms);
                return Encoding.UTF8.GetString(ms.ToArray());
            }
    
Ber53rker
  • 1,036
  • 3
  • 17
  • 26
  • Can you clarify. You are submitting a multi-part form data from C# code? Or are you trying to read a multi-part form submit? – SlaterCodes Jan 06 '14 at 23:45
  • This is a bit vague. What are you trying to do ? Work with a file that was uploaded from a web form ? – sh1rts Jan 06 '14 at 23:46

0 Answers0