0
votes

I am using Silverlight 2 and new to Silverlight 2. I want to develop a ASP.Net web application which uses Silverlight at client side (in browser) to let end user select a file to upload to server side. The server is running ASP.Net 3.5 on IIS 7.0. A special requirement is I want to control the upload speed, for example, for 10M file I want to upload in minimal 10 seconds to have max bit rate to be 1M. Shall I use WCF at silverlight client side to control such behavior?

I am using VSTS2008 + C# + .Net 3.5. Any samples to make reference?

3

3 Answers

1
votes

This should do the trick.
If not, consider some of these.

I don't know much about WCF, I'm afraid... It might work...

EDIT: On second thought, I'm fairly certain that bandwidth quota is generally configured in the hosting server, rather than simply in your app. If you want the bandwidth to be dynamically configurable via your app, the best option is to manipulate the server's per-connection bandwidth control from your app. I'm not sure how to run server commands from a Silverlight app, but I imagine you should still be able to fire off a batch file or something...

1
votes

If bandwidth throttling on the client is an absolute requirement you can use sockets. It's quite easy to create a server to which the silverlight application can connect and send the file. And when you have full control over the send loop it's easy to throttle the bandwidth. You might even see some performance gains. Compared to the standard WCF upload this is about 10 times as much work though.

I've built an application like this once, unfortunately I don't own the code.

Here's the msdn article on sockets in silverlight: http://msdn.microsoft.com/en-us/library/cc296248(VS.95).aspx