Download Link BBCode

A selection of BBCodes for use on your phpBB3 Forums.
User avatar
man128
Forum Member
Forum Member
Posts: 23
Joined: Fri Jun 06, 2008 7:30 pm

Re: Download Link BBCode

Post by man128 »

I have seen alot of force download php code out there that will force the download box to appear and download any file on internet explorer and prevent media player from opening.
here is what i have found.
http://elouai.com/force-download.php
:thumbsup:
Spoiler: show
<?php

// force to download a file
$file = "http://localhost/test/".$_GET['file']."";

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($file));

header( "Content-Description: File Transfer");
@readfile($file);

?>
User avatar
man128
Forum Member
Forum Member
Posts: 23
Joined: Fri Jun 06, 2008 7:30 pm

Re: Download Link BBCode

Post by man128 »

Can anybody try to figure out a way to convert the above code into a bbcode? :banghead:
User avatar
cisco007
Staff
Staff
Posts: 501
Joined: Tue Oct 07, 2008 3:44 am

Re: Download Link BBCode

Post by cisco007 »

i don't know if you can make that into a bbcode, you need html and java to make a bbcode, don't know if you can do it with php! :thumbsup: What do you think LDM?
User avatar
Ashley
Forum Member
Forum Member
Posts: 242
Joined: Fri May 30, 2008 10:15 pm

Re: Download Link BBCode

Post by Ashley »

If it is a divx file they are downloading, won't their player prompt them to download the codec anyway?
User avatar
man128
Forum Member
Forum Member
Posts: 23
Joined: Fri Jun 06, 2008 7:30 pm

Re: Download Link BBCode

Post by man128 »

It is not a Divx file, it is a .avi file. Everytime they try to click the file to download it opens up their media player instead. :scratch:
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Download Link BBCode

Post by LDM »

Isn't that what you want it to do though? It may be different depending on what player they have set up to play avi files.
Looney
Forum Member
Forum Member
Posts: 2
Joined: Tue Nov 17, 2009 10:33 pm

Re: Download Link BBCode

Post by Looney »

How can you make the text appear below the image?
User avatar
LDM
Site Admin
Site Admin
Posts: 1786
Joined: Thu May 29, 2008 6:51 pm

Re: Download Link BBCode

Post by LDM »

Try this for your html instead for text under. Not tested so may have to post if not working.

HTML:

Code: Select all

<table>
<tr>
<td title="Download Here !!" onclick="window.location.href='{URL}'" style="cursor:pointer;"><span onmouseover="this.style.color ='#FF0000';" style="font-weight: normal; font-size: 11px; color: #000000; font-family: Arial;" onmouseout="this.style.color='#000000';"><b>&nbsp;Download Here !!</b></span></td>
<td title="Download Here !!" onclick="window.location.href='{URL}'" style="cursor:pointer;"><img src="images/download.png" alt="" /></td>
</tr>
</table>
Looney
Forum Member
Forum Member
Posts: 2
Joined: Tue Nov 17, 2009 10:33 pm

Re: Download Link BBCode

Post by Looney »

Tested it and the text went bottom left but not below the image. Thanks for your time LDM, appreciate it alot
the4thmoz
Forum Member
Forum Member
Posts: 1
Joined: Mon Apr 05, 2010 7:59 am

Re: Download Link BBCode

Post by the4thmoz »

Thx verry much
NeoFury
Forum Member
Forum Member
Posts: 5
Joined: Thu Jun 03, 2010 1:36 pm

Re: Download Link BBCode

Post by NeoFury »

awesome, thanks!
Post Reply