Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.9
Author Message
JoLo
New Member
New Member



Joined: Aug 27, 2003
Posts: 14

PostPosted: Fri Feb 02, 2007 1:01 am Reply with quote

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.
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Fri Feb 02, 2007 6:07 am Reply with quote

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.
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Feb 02, 2007 7:11 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
JoLo







PostPosted: Fri Feb 02, 2007 4:21 pm Reply with quote

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







PostPosted: Fri Feb 02, 2007 4:28 pm Reply with quote

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







PostPosted: Fri Feb 02, 2007 4:43 pm Reply with quote

huh...even im not following this anymore.... Confused
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..... Laughing
its because the movie starts playing they see the address...
 
montego







PostPosted: Fri Feb 02, 2007 5:13 pm Reply with quote

well, if you want to be THAT easy! Laughing
 
hitwalker







PostPosted: Fri Feb 02, 2007 5:17 pm Reply with quote

no seriously monty..... Laughing

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.... Cheers
 
JoLo







PostPosted: Fri Feb 02, 2007 5:44 pm Reply with quote

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

PostPosted: Fri Feb 02, 2007 5:52 pm Reply with quote

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 
View user's profile Send private message
JoLo







PostPosted: Fri Feb 02, 2007 6:13 pm Reply with quote

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







PostPosted: Sat Feb 03, 2007 7:35 am Reply with quote

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

PostPosted: Sat Feb 03, 2007 8:30 am Reply with quote

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 )
 
View user's profile Send private message
JoLo







PostPosted: Sat Feb 03, 2007 11:30 am Reply with quote

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







PostPosted: Sat Feb 03, 2007 12:40 pm Reply with quote

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







PostPosted: Sat Feb 03, 2007 3:13 pm Reply with quote

So how would I go about GZipping (you like my word?) the files already on the server?
 
JoLo







PostPosted: Sat Feb 03, 2007 5:32 pm Reply with quote

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







PostPosted: Sun Feb 04, 2007 6:45 am Reply with quote

Interesting... I would never have thought of that, but now it is in my "repertoire". Thanks for sharing this!
 
JoLo







PostPosted: Sun Feb 04, 2007 9:16 am Reply with quote

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







PostPosted: Tue Feb 06, 2007 5:41 pm Reply with quote

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.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.9

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©