The Correct way to pass FileUpload content into [WebMethod]?

后端 未结 1 908
礼貌的吻别
礼貌的吻别 2021-01-26 23:10

I have a [WebMethod] Sendemail This works fine but now i what to upgrade it to send attachments. I am using a fileupload. This is my method Call.

lblEmailSent.Te         


        
相关标签:
1条回答
  • 2021-01-27 00:02

    the second error it gives you hits the nail on the head, yes youre passing string string string string but youre passing the wrong type of stream for it to interact with, it wants this kind WebTestServiceApp.localhost.Stream youre giving it this kind System.IO.Stream

    when you use the stream try explicitly declaring it as a WebTestServiceApp.localhost.Stream when you first make it, that way youre then passing the right types of stream and your problem should stop!

    theres two types of stream you see, one used for web apps and one used for desktop apps.

    0 讨论(0)
提交回复
热议问题