0

What is the best way to allow visitors to a website to download files the size of tens of gigabytes? In this case it is about movie files, so they are already relatively compressed.

Here are some assumptions:

  • Only one visitor will want to download a file at any time and nobody other than our servers has the file at any one time.

  • There is a high probability that the transfer will be interrupted due to network problems or other problems, so some kind of resume should be available.

  • The visitor will get a download link either on the website or via email.

  • Should work at least for visitors running Windows or OS X. It would be a bonus if it also works with some Linux distribution.

My experience with FTP and normal HTTP is that some visitors manage to download what they believe is the entire file but it then turns out not to be working because the file is incomplete or corrupted.

Printing the md5 sum or similar on the website and asking the visitor to run md5 on the download and then compare the results is too complicated for most website visitors.

Zipping the file adds a layer of error checking and completeness checking but often adds some manual steps for the visitor.

Is there some better solution?

tomsv
  • 7,207
  • 6
  • 55
  • 88

1 Answers1

1

I will presume you have custom videos on a closed web site that are per user. If this is the case you might want to implement a custom download manager that does just what you described: 1. grabs the link via magnetic link 2. downlaods the file and checks it against MD5hash 3. supports resume

An easy way to do this is to use external tool like wget to do this. to resume with wget you use -c option, here is an article describing this in greater detail: http://www.cyberciti.biz/tips/wget-resume-broken-download.html After this you want to check md5sum, asuming md5 hash is in file named filename.md5. This presumes that you have md5sum and wget on your system.

wget -c urlToYourfile{file.avi, file.avi.md5}

md5sum -c *.md5

So the actual code would be just a simple wrapper with easy installer that would do this. alternatively this could be done in a bit less fancy way with .bat script it just comes down to associating the script with url type and than jsut specify url in this way: mydownload://url/file.avi and set browser to do this ... but if you have multiple random users it is actually easier to just make a simple wraper for magnetic links and voila

Best regards!

ziga
  • 131
  • 1
  • 8