Ok first of all, the unicorn avatars are hilarious. Seriously, I thought my account was compromised. Happy April Fool's day.
Now I'm uploading files via Silverlight to the server. What is the best way to notify Silverlight that the files have been uploaded? Perhaps even toss other information back such as success/failure etc.
I followed a simple tutorial here for my file upload logic
First of all re-write the UploadFile function as follows:-
Now you can use this function like this:-
There is a way to upload file and get server response using
WebClient
inSilverlight
.Internally
UploadStringAsync
converts string to bytes through its Encoding:So, I wrote simple base64 encoding wrapper (only actually used methods in my scenario are implemented):
Now uploading looks like: