开发者

Identifying the download status of a file in web application

开发者 https://www.devze.com 2022-12-13 13:02 出处:网络
I am developing a web application in .Net 2005 in C#. Here there is a provision that allows the user to download the file from o开发者_JAVA百科ur server which will be mostly .doc files. So I am using

I am developing a web application in .Net 2005 in C#. Here there is a provision that allows the user to download the file from o开发者_JAVA百科ur server which will be mostly .doc files. So I am using Response.TransmitFile and content-disposition header method to write the file to the client.

My current requirement is to identify the status of the file being downloaded. If the file download is success/ failure then I have to show a status message in my web page.

I am not aware of any method that can do this kind of action in ASP.Net. So any help would be appreciated. The main problem is that the user can use any external Download Manager tools to do the download process and he can close my application from his browser and continue the download process at a later time.

Edit

Success in the sense that I have to identify whether all the bytes were downloaded or not.

Thanks


I'm not certain that there is anything you can do to measure download success. The client has issued a request, which you have responded to with a 200 status and with content. At best, you could determine whether all the content was sent. You cannot know what the client did with the content.

As an extreme example, how could you know on the server if the client received all of your content, and then crashed the computer? How could you know that all content was received and then the file was opened in Word? As far as the server is concerned, these two events are the same.

0

精彩评论

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

关注公众号