开发者

Uploading file(s) to webserver in silverlight (C#)

开发者 https://www.devze.com 2022-12-18 16:23 出处:网络
Alright, so i have a silverlight application, it opens a filedialog, gets the selected file, transfers it to asp.net which saves it to the server, but i want to know how to implement a progress 开发者

Alright, so i have a silverlight application,

it opens a filedialog, gets the selected file, transfers it to asp.net which saves it to the server, but i want to know how to implement a progress 开发者_如何学编程bar for it. for big files, and multiple file uploads, i will need to know the progress of the file upload to the server, is this possible?


You will probably save yourself a lot of time and heartache by just integrating this Silverlight File Upload codeplex project into your app.

You can't actual get good progress information from the standard WebRequest or WebClient components. Not only do they not send any of the Request stream until your code has finished writing to it (a decision I can't begin to understand), it doesn't provide any progress events once it starts sending it. For reasons I can't begin to fathom you can get progress events when sending a string, go figure.

I can only guess that these limitations arise from Silverlight needing to operate in multiple browsers and therefore the interface to the Browser HTTP transport is kept as basic as possible.

0

精彩评论

暂无评论...
验证码 换一张
取 消