title: How Do i pass a file into a web method?
body: <p>I would like to pass a file into a [Webmethod] and once its inside, send it as an email attachment.</p>
  
  <p>How would i go about doing this? I'm unsure where to start?</p>
  
  <p><strong>FileUpload1.PostedFile.FileName</strong> and <strong>FileUpload1.FileContent</strong> are the 2 things i want to pass into my [webmethod].</p>
  
  <p>My Problem is the <strong>FileUpload1.FileContent</strong>, because i can already send my <strong>FileUpload1.PostedFile.FileName</strong> as a String</p>
  
  <pre><code>lblEmailSent.Text = Send.Sendemail(txtTo.Text, txtSubject.Text, txtbody.Text, FileUpload1.PostedFile.FileName, FileUpload1.FileContent);
  </code></pre>
  
  <p>My Call Statement is underlined in blue and the two error given look like:</p>
  
  <blockquote>
    <p>*<em>1)</em>*The best overloaded method match for
    'WebTestServiceApp.localhost.Service1.Sendemail(string, string,
    string, string, WebTestServiceApp.localhost.Stream)' has some invalid
    arguments</p>
    
    <p>*<em>2)</em>*Argument 5: cannot convert from 'System.IO.Stream' to
    'WebTestServiceApp.localhost.Stream'</p>
  </blockquote>
  
  <p>Please could someone show me how i can send <strong>FileUpload1.FileContent</strong> into a [Webmethod]</p>
  
  <p>Thanks in advance.</p>