That's MY Bandwidth!!!
March 3, 2006 6:39 PM   Subscribe

I have a website on which I host videos. I don't want users to click the video links and watch the videos right off my server. I would like the user to click the link and get one of those boxes that asks them to save it to their computer so they can watch it on their hard drive. How do I do this?
posted by JPowers to Technology (21 answers total)
 
How could this save bandwidth?
posted by matthewr at 6:42 PM on March 3, 2006


It could save bandwidth by reducing the number of times the same person downloads the same video clip, because they're forced to save it to their hard drive.

Unfortunately, there is no way to absolutely, positively force this. The only real way to guarantee it is to store the file as a zip or some other extension they must download and then decompress, which is annoying.
posted by twiggy at 6:47 PM on March 3, 2006


Sorry, I should clarify why you can't force this: What really matters is the platform on the other end. If their IE or Mozilla (or Opera, etc) is configured to play the file in the browser, that's what it's going to do. There is no way to override this short of giving the file out in a format that the browser cannot play (i.e. zip).
posted by twiggy at 6:50 PM on March 3, 2006


If you control the webserver, change the MIME type for the movies to be application/octet-stream.

If you don't control the webserver, rename the files to "moviename.mov.exe". This will force them to be downloaded since they won't be recognized as movie files. Tell the user to rename them to "moviename.mov" once they are saved. Note: this will confuse X% of your users.
posted by jellicle at 7:05 PM on March 3, 2006


You can send a fake MIME type to greatly increase the chance that a download dialog will appear. I've seen 'application/force-download' used in the past.

To change the MIME type, you would have to either write a script to explicitly return the file as this type, or reconfigure your server. But you'd have to give more details about your setup before anyone could give more specific instructions.
posted by helios at 7:05 PM on March 3, 2006


I wouldn't recommend returning 'application/octet-stream' though, because lots of dumb browser plugins (such as Quicktime) have decided to handle that extension as well. So it doesn't work as well as it used to for forcing downloads.
posted by helios at 7:06 PM on March 3, 2006


Here is the proper way to set the mimetype, using the content-disposition header. You should be able to google how to do it on your server from that.
posted by smackfu at 7:10 PM on March 3, 2006


(BTW, "Proper" because it's RFC 2183 and is intended specifically to override how things are handled on the client side. Its original use was for mail clients, so that some mime attachments like pictures would be shown inline and some would be listed as files. But all the common browsers support it for web docs too.)
posted by smackfu at 7:13 PM on March 3, 2006


forced to save it to their hard drive

This is not a streaming server, right, but a HTTP server? In that case, aren't most clients caching a local copy of the file anyway on the client disk?
posted by meehawl at 7:16 PM on March 3, 2006


This is not a streaming server, right, but a HTTP server? In that case, aren't most clients caching a local copy of the file anyway on the client disk?
posted by meehawl at 9:16 PM CST on March 3 [!]


Yep. This whole thing is almost always going to be pointless.
posted by cellphone at 7:22 PM on March 3, 2006


You're basically breaking the entire point of MIME types. Don't do it, please.
posted by devilsbrigade at 7:34 PM on March 3, 2006


How about a low-tech solution?

Create a link with BIG BOLD EASY-TO-READ INSTRUCTIONS to "Hold down the shift button, left-click link, select save-as, remember where you saved it to."
posted by PurplePorpoise at 7:38 PM on March 3, 2006


If you have enough traffic that the occasional user watching the same video multiple times is enough bandwidth to be worth thinking about, you should consider putting the files into bittorrents, which will both force downloads and spread the bandwidth among all downloaders, cutting your bandwidth down even further than just forcing downloads.
posted by scottreynen at 7:59 PM on March 3, 2006


A really common solution to this problem is to put the movies in zip files.
posted by aubilenon at 9:01 PM on March 3, 2006


I really would like JPowers to tell us why he/she wants it to happen this way, i.e. what he/she believes about the difference between the two things.

This is about the third time I've seen people ask this, or tell site visitors they must download. It's presumably because they believe it saves bandwidth, but who knows?

So, if you wouldn't mind, JPowers, why did you believe there's a benefit to you from making this happen the way you want?
posted by AmbroseChapel at 9:33 PM on March 3, 2006


I believe that jpowers is worried about other sites linking to the raw video files and/or embedding them into their pages, instead of the viewers looking at them through his page. See hotlink protection.
posted by charmston at 9:46 PM on March 3, 2006


The header('Content-Disposition: attachment; filename=whatever.avi') thing ought to work. Don't make up a random MIME type and don't lie about the correct MIME type.
posted by Rhomboid at 10:28 PM on March 3, 2006


Forget all the "that's not what MIME is supposed to do!" crap. The problem is that, as mentioned above, changing the MIME type isn't going to necessarily solve your problems if an application has already been set up on the client's machine to handle it.

I'd second aubilenon's solution to just ZIP up the files. Make sure you also provide a link for a decompression program. It's a pretty elegant solution.
posted by Civil_Disobedient at 8:51 AM on March 4, 2006


I believe that jpowers is worried about other sites linking to the raw video files and/or embedding them into their pages, instead of the viewers looking at them through his page.

Ah. You know, that makes sense.

But still, I have seen people who've explicitly written into their pages "if you want to watch these videos, please right-click and download them, don't click on them directly, because that saves my bandwidth" -- what's the explanation for that?
posted by AmbroseChapel at 9:39 PM on March 4, 2006


AmbroseChapel: See above.
posted by charmston at 4:29 PM on March 5, 2006


You mean this bit:

It could save bandwidth by reducing the number of times the same person downloads the same video clip, because they're forced to save it to their hard drive.

There's a couple of huge suppositions being made there. People watch the same movie clip more than once, and, the clip doesn't get cached, and, the site user somehow knows that the same person watches clips more than once, or assumes they do.

I'm still waiting for the original poster to reply, sadly.

And the thing about remote linking, which you posted earlier, is actually contradicted now that I read the original post again. JPowers talks about people visiting his/her site, and clicking. Not a hint that remote linking is part of the problem.

JPowers, where are you?

Where did you get the idea that you will save bandwidth by forcing people to download and watch from their hard disk rather than watch over the internet?
posted by AmbroseChapel at 4:57 PM on March 5, 2006


« Older Starbuck's jacket?   |   The definitive spit-roast whole pig. Newer »
This thread is closed to new comments.