Author: thomasvsundert | Posted on: 6/23/2008 8:35:07 AM | Views : 946


 Hi,

I'm implementing a file upload in Silverlight (I encode the file to a base64 string an send it to an asmx-webservice) and I have following questions:

1) Which of the webclient methods is the best to do this (my quess would be the uploadStringAsync-method)

2.) my webmethod looks like this: public string UploadImage(string data), how do I pass the data? I tried doing the following:

WebClient client = new WebClient();
client.UploadStringCompleted +=new UploadStringCompletedEventHandler(client_UploadImageCompleted);

client.UploadStringAsync(new Uri(url + "/myWebservice.asmx/UploadImage", UriKind.Absolute), "data=" + fileContents);

but then the webservice is not called and I just get an empty result.
How do I have to pass the parameter?
Thanks
Thomas


...

Go to the complete details ...