I put in code to upload a file from the user. Now I'd like, if possible, to do two things. First, and most important:
1. Send an email with form responses and the uploaded file attached. I looked for MailMessage that's in the WPF stack, but no dice here, unless I am missing something.
Then
2. Save the uploaded file and form responses to a folder on the server. I've tried WebClient and WebClientWithCredentials. I get "No 'Access-Control-Allow-Origin' header is present on the requested resource"
Code: Select all
WebClient webClient = new WebClient();
webClient.UploadStringAsync(new Uri("http://www.heavenword.com/sv2dos/firsttest.txt"), "testing123");
or
Code: Select all
WebClientWithCredentials webClientWithCredentials = new WebClientWithCredentials();
webClientWithCredentials.CredentialsMode = CredentialsMode.Enabled;
webClientWithCredentials.Encoding = Encoding.UTF8;
webClientWithCredentials.Headers[HttpRequestHeader.AcceptEncoding] = "application/xml";
webClientWithCredentials.UploadStringAsync(new Uri("http://www.heavenword.com/sv2dos/firsttest.xml"), "testing123");
I believe I enabled write access to the above sv2dos folder on the server.
I realize I'm asking for more server-side integration than the thick client, but I thought I would find examples here in the forum on how to do that. I ran several searches, but came up empty.
Any suggestions?