I’m using VS2010, C# to develop a web-based (in-browser) Silverlight 4 app, I’m reading emails (currently gmail) using IMAP, I use a WCF in my Silverlight to access gmail data. Everything is going fine but I have problem in downloading attachments, I can get email attachments in byte array, there is no problem in saving these bytes using Response.Stream or File.WriteAllBytes (in ASP.NET pages). But when I want to save them in my SL app I have two problems: it seems that I cannot use Response in my WCF, and also File.WriteAllBytes give me this error: File operation not permitted, access denied to myfilename. what are my options to download attachments in my SL app? should I return my file data as byte[] to SL app or I should save them directly in WCF?
what methods should I use? response? file? or something else, thanks
This is how you save
byte[]to file in SL4: