Author |
Message |
JoLo
New Member


Joined: Aug 27, 2003
Posts: 14
|
Posted:
Fri Feb 02, 2007 1:01 am |
|
Ok, in my Downloads section, I feature MPEG video clips. But when the button is pressed to start the download, the video opens up in the browser and the full URL to the download is displayed in the browser. I need some Content-Disposition or something to force the download dialog box to appear. Please someone help. I need this ASAP and I will pay a reasonable price. |
|
|
|
 |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Fri Feb 02, 2007 6:07 am |
|
well if the idea is that the files should be downloaded then best is not to offer it in its original extension (movie).
just pack it in zip,then the download dialog box will appear. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Fri Feb 02, 2007 7:11 am |
|
I wonder if this thread might have a "gem" inside it...
http://www.ravenphpscripts.com/postx8505-75-0.html
Sorry, it is a long thread, but there is a code change that you can make (don't use the .htaccess only method, it does not work) to accomplish this I believe. Or a variation of it. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
JoLo

|
Posted:
Fri Feb 02, 2007 4:21 pm |
|
It seems that post will allow me to block other people from linking to my direct downloads. That's good and all. But what I also need is some piece of code that will force a MPEG file to open the download dialog instead of trying to play the clip in the web browser. My users want to download the video and save on their computer. |
|
|
|
 |
montego

|
Posted:
Fri Feb 02, 2007 4:28 pm |
|
Given that the header content type is different, it might work. Try it and see. Can't hurt right? Its such a minor change. You won't need the .htaccess piece of it. |
|
|
|
 |
hitwalker

|
Posted:
Fri Feb 02, 2007 4:43 pm |
|
huh...even im not following this anymore....
wasnt this all about a movie that opens when clicked on?
but he doesnt want that....right?
JoLo...tried to zip the movie ?
thats all it takes.....
its because the movie starts playing they see the address... |
|
|
|
 |
montego

|
Posted:
Fri Feb 02, 2007 5:13 pm |
|
well, if you want to be THAT easy!  |
|
|
|
 |
hitwalker

|
Posted:
Fri Feb 02, 2007 5:17 pm |
|
no seriously monty.....
he said...
Quote: | the video opens up in the browser and the full URL to the download is displayed in the browser |
so correct me if im wrong......most simple way is to pack it in zip...right?
have a beer on me....  |
|
|
|
 |
JoLo

|
Posted:
Fri Feb 02, 2007 5:44 pm |
|
Yeah, of course I could just upload ZIP files and solve the problem. But a lot of my users aren't as seasoned as you guys and don't know what to do with a ZIP file. I just want to make it as easy as possible for them to download the videos and play them.
AVI files seem to open the download dialog window on my computer. Are there any browsers that would try and open that in the browser? Is it a matter of changing you brower preferences?
I'll try that post now montego. Thanks for your prompt responses.
Could I ZIP the files while they are still on the server? I've seen sites who have GZIP compression on the fly. I have a dedicated server so I have root access if that's the issue. Just wondering. |
|
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Fri Feb 02, 2007 5:52 pm |
|
Isn't it totally a browser issue? I can tell my browser what to do with certain files...either save them or open them in some external viewer. That's why so many people put "right-click on this link and choose save-as" under their links. |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
JoLo

|
Posted:
Fri Feb 02, 2007 6:13 pm |
|
Yeah, but I'm using buttons to prevent the "right click, save file as..." function.
And to montego, I used the code from that post and it didn't work for me. All that I can see it did was make the file type appear to be "Unknown" but if clicked, it still opens in the browser. |
|
|
|
 |
montego

|
Posted:
Sat Feb 03, 2007 7:35 am |
|
Ok, then hitwalker's approach of making these zip files is about the only other option. You can also give it some unknown file extension, but I think that is worse than putting it into a zip file. |
|
|
|
 |
KennyW
Hangin' Around

Joined: Jul 15, 2004
Posts: 44
|
Posted:
Sat Feb 03, 2007 8:30 am |
|
You must zip/rar or something like that to get this to work,the browser starts to stream them automatic,and the reason that the AVI is not doing that is that Div X/X-Vid/AVI etc are not streamable (or how you spellit ) |
|
|
|
 |
JoLo

|
Posted:
Sat Feb 03, 2007 11:30 am |
|
OK, I guess the zipped files is the only way to go. Thanks for all the help.
Any way to ZIP the files while they are on the server? I have root access if that helps. |
|
|
|
 |
montego

|
Posted:
Sat Feb 03, 2007 12:40 pm |
|
Could depend somewhat on the version of unzip/winzip that the client PC has installed, but I have had good luck with both simple "compress" and "gzip". My preference is gzip and it will give you a .gz extension, but should work just fine.
Yes, there are better compression ratios possible, BUT, I try personally to go with a lower common denonminator... |
|
|
|
 |
JoLo

|
Posted:
Sat Feb 03, 2007 3:13 pm |
|
So how would I go about GZipping (you like my word?) the files already on the server? |
|
|
|
 |
JoLo

|
Posted:
Sat Feb 03, 2007 5:32 pm |
|
I found a super easy solution that seems to be working. I made a .htacess file with the following code within it:
Code:AddType application/octet-stream mpg
|
Bingo. |
|
|
|
 |
montego

|
Posted:
Sun Feb 04, 2007 6:45 am |
|
Interesting... I would never have thought of that, but now it is in my "repertoire". Thanks for sharing this! |
|
|
|
 |
JoLo

|
Posted:
Sun Feb 04, 2007 9:16 am |
|
I actually found another way of doing this and it seems more reliable. Check this out:
http://elouai.com/force-download.php
With that, I can just link the file to forcedownload.php?file=movie.mpg and it will prompt the download menu instantly. |
|
|
|
 |
montego

|
Posted:
Tue Feb 06, 2007 5:41 pm |
|
Take heed of the warnings about security with that! I have not personally reviewed this, but the language in the page you provided makes ME really nervous. |
|
|
|
 |
|