views:

42

answers:

2

My website hosts a msi file that users need to download. There is nothing special about the file. It lives in a directory on the webserver with a regular HREF pointing to it that users click on. Occasionally a user will complain that they can't open the msi file because Windows Installer claims the file is corrupt. Redownloading the file doesn't help. I end up emailing the file as an attachment which usually works.

My guess is that the file is either corrupted in the user's browser cache or perhaps an intermediary proxy's cache which the user goes through.

Why does this happen? Is there a technique / best practice that will minimize chances of corruption or, perhaps make sure users will get a fresh copy of the file if it does get corrupted during download?

+1  A: 

My advice would be:

  1. Recommend users avoiding IE (especially the older versions), because of truncated downloads, cache pollution...
  2. Advice user to clear the cache before re-downloading the files.
  3. Host the file on an FTP instead of HTTP
  4. Provide MD5 checksum for user to verify the download.
Hypnos
The end users are very inexperienced, ideally I don't want to impose any restrictions on the tools they use or ask them to clear their cache.
Nonane
+1  A: 

Well if the cause is really just the cache, then I think you could just rename the file before having them download it again. This would work for any proxies too.

Edit: Also, I believe most browsers won't cache pages unless the Get and Post parameters remain the same. The same probably applies to any URL in general. Try adding a unique get (or post) parameter to the end of the URL of each download. You could use the current time, or a random number, etc. Rather than a hyperlink, you could have a button that, when clicked, submits a form with a unique parameter to the download URL.

Wallacoloo
This would require me to manually change the name or have two links to the file, which I'd rather not do (though it looks like I may not have a choice).I've noticed some sites require you to POST some data to the server before the download starts. For example, most Microsoft downloads require you to click a 'submit' type button to start the download. Any idea why that is?
Nonane
@nonane: I updated my answer with my _theory_ of why.
Wallacoloo
@wallacoloo - I haven't tested out your theory though I think you might be right about this.
Nonane