![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
Can you configure Apache to do this?
Make Apache play .mp4 files as usual but
make Apache download .MP4 files to the users computer. Is this possible? If so, how? Thanks for your help ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
Quote:
What I'm trying to do is have a solution where I have one copy of each video file. Where .mp4 plays in my video player for member and when they click the download link, it will link to a .MP4 copy that downloads automatically. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
bump
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
you could use htaccess like this in the folder with the videos
Code:
RewriteEngine on RewriteRule ^(.*)\.MP4 mp4.php?x=$1 [nc] Code:
<?php $x = $_GET['x']; $file = "$x.mp4"; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); exit; } else { echo "bad request"; } ?>
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
Quote:
This is great THANK YOU! Before reading your post I came across a recomendation to add this to my .htaccess AddType application/octet-stream .mp4 <FilesMatch "\.(docx?|txt|mp4?)$"> Header add Content-Disposition "attachment" </FilesMatch> So far what this does is allows my jwplayer to play .mp4 files, but when a link with an .mp4 file is clicked, the user is prompted to download the file. So I don't need two copies of the video file. Do you see any drawback to this? I'm not big on programming and have no idea if this doesn't work for everyone. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
Quote:
but really you just need the htaccess you posted because the player will stream it either way
__________________
hatisblack at yahoo.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
Yes I definately need to embed.
This works for me on Chrome and Internet Explorer. Click here to see an example. Does this embed and download the same file for you guys too? If not, what browser and OS are you using? I really appreciate the help ![]() . |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
Works for me in Opera.... but you might have issues with cellphones (androids) playing the video as I think they need to see the proper mime type. That's one of the reasons trying to "fake it" in apache etc isn't done and ppl have to right click to download or run the download thru a separate script.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
Instead set the headers in the .htaccess.
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
Instead set the headers in the .htaccess. Smokey did manage to halfway avoid one bug, so his implementation has only 2 1/2 major issues. That's definitely better than most people do. Still remaining is the big which for about a year caused one popular CMS to crash servers fairly regularly and this code too will crash your server when it gets busy. It also has a glaring security hole. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | ||
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,229
|
Quote:
Quote:
However on my IPad no video shows, only the "download" graphic appears, and when clicked on, it plays the video. On my Android phone no video shows, only the "download" graphic appears, and when click on, it downloads the video to the phone without viewing. So maybe if I adjust the longtail player setting to be html5 compatible it could fix this problem? Thanks for your input I really appreciate it ![]() |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
By the way, what any of this does is SUGGEST to the browser that a file could be saved in the one case or played in the other case. There is absolutely no forcing going on. You can't MAKE them save the file to the hard drive. As far as you know, they may be on a diskless system that doesn't even HAVE a hard drive. You're merely suggesting an appropriate way the file could be handled.
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
Quote:
__________________
hatisblack at yahoo.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Does the automatic forfeit for triggering Godwin's law apply to jokes?
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
the south park "grace period" has expired on using nazi's in jokes, it is ok now..
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |