开发者

IIS Hosted file is finished downloading at 66%

I have an android application that is downloading a file from a server that is hosting the file with IIS. I have a progress bar that is shown to the user while the file is being downloaded. If I host my file on dropbox and grab it from the开发者_高级运维re instead of my IIS server the progress bar works correctly. However when I grab the file from the IIS server the last update that the progress bar gets bumps it to 66% then the file is done downloading. I checked the file size after download and it is definitely getting the whole file. It is an mp4 file that I am working with, I have the MIME type for '.mp4' set to: 'video/mpeg' though I have also tried 'video/mp4', and 'file/mpeg' none of which corrected the problem. I thought maybe it had something to do with the Compression setting in IIS so I disabled both static and dynamic compression, this made the progress bar go all the way to 100%, but made the download take WAY longer. Is there some other setting in IIS that could be causing this behavior?


I had Dynmaic Compression enabled on the IIS server and that was causing the response to the HTTP request to contain a file size that was larger than the actual file. The size that I was getting in that response is how I was figuring out how far to set the progress bar. It was smart enough to realize that the file was finished when it was, but the progress bar was basing its progress on an inflated file size. I am not sure why dynamic compression would make it report a size that is larger than it is in reality. I would've thought if anything it would give a smaller size. But anyhow, I turned off dynamic compression and all is well now.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜