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