views:

63

answers:

1

We have customers who are trying to download a setup.exe file over mobile connections that appear to be very slow.

They have reported that when they click on the downloaded setup.exe, the install wizard starts up, but part way through the wizard they get an error message indicating that a cab file is corrupt or missing.

They couriered a problem tablet to us, and we downloaded the file without a problem but I could replicate the problem by using https to download the file (https is normally used to access the rest of the site, although it is not necessary for the download). When I did this the downloaded file was 2.8MB. It should be 8MB.

I don't think that https is the root cause of the problem because I can see the download link in the browser history using http, so I know the customer tried to download using http. I think that the issue is that the poor connection is preventing a complete download, but the browser is acting as if it is complete.

Is there a way to ensure the file is downloaded fully, or not at all? Why does the browser not indicate that the download is incomplete?

+1  A: 

Most likely, the web server the EXE file resides on doesn't send a Content-Length header. If this header is absent, the only way the browser can determine if the download is complete is "when the bytes stop coming", i.e. the TCP/IP connection is closed or times out. If the connection quality is low, this may very well happen prematurely.

Another option is that the header is sent, but that the browser ignores it. Such a level of brain damage is pretty rare these days, though, but possible if your browser is something nonstandard/embedded/ancient.

So, the solution to this issue is probably to fix the HTTP server. And have a look at the options for the software you use to build the setup package: possibly there is a setting there to create a hash (or at least remember the desired length) of the final EXE, and to complain with a more sensible error message if the archive is corrupt.

mdb
You are absolutely right about there being no Content_Length header. I actually have code (C#) to open a FileStream and sent it to the Response. I have now added the Content-Length to the Response header, and now I get a nice dialog with the file size and a progress bar. I tried to simulate an incomplete download by setting a breakpoint in the debugger, and prematurely exiting. However, the browser (IE7) still reported that the download was complete - despite getting 17kb instead of 8MB. I think maybe my test isn't correct because I may still be sending a Response.End.......
Colin