What is the download call

All support enquiries for DFH go in here...

What is the download call

Postby asktod » Sat May 19, 2012 11:30 pm

What is the code that calls the file to be downloaded like the one once you press download. Trying to add media embedding
asktod
Standard Member
 
Posts: 12
Joined: Wed May 02, 2012 8:57 pm

Re: What is the download call

Postby SamEA » Sun May 20, 2012 1:16 am

What exactly are you trying to accomplish?
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: What is the download call

Postby asktod » Sun May 20, 2012 1:48 am

SamEA wrote:What exactly are you trying to accomplish?

Playing media. Do you know what the file download code is?

this is what I have
Code: Select all
<?php echo $scripturl. "download.php?a=" . $filecrc . "&b=" . md5($foundfile[2].$_SERVER['REMOTE_ADDR']) ?>
asktod
Standard Member
 
Posts: 12
Joined: Wed May 02, 2012 8:57 pm

Re: What is the download call

Postby SamEA » Tue May 22, 2012 12:08 pm

File Download code? Do you mean the direct link to the uploaded file? ./download2.php is where a download link is generated, which enables the user to download a file. If you are trying to implement a video player or similar, you'll have to customise download2.php's HTML Headers' MEME type to application/x-shockwave-flash (for SWF) for example.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: What is the download call

Postby asktod » Wed May 23, 2012 12:47 am

This have something to do with it?
"
$validdownload = 0;


$filecrc = $_GET['a'];
$filecrctxt = $filecrc.".dfh";
if (file_exists("./files/".$filecrctxt)) {
$fh = fopen ("./files/".$filecrctxt,r);
$thisline= explode('|', fgets($fh));
if ($thisline[0]==$_GET['a'] && md5($thisline[2].$_SERVER['REMOTE_ADDR'])==$_GET['b'])
$validdownload=$thisline;
fclose($fh);"
asktod
Standard Member
 
Posts: 12
Joined: Wed May 02, 2012 8:57 pm

Re: What is the download call

Postby SamEA » Sat May 26, 2012 1:06 am

Nope, this part in ./download2.php:
Code: Select all
header('Content-type: application/octetstream');
header('Content-Length: ' . filesize("./storage/".$validdownload[0]));
header('Content-Disposition: attachment; filename="'.$validdownload[1].'"');
readfile("./storage/".$validdownload[0]);


Basically, I'd recommend the user to click on "Download Now" (in which you can modify the template e.g. DL Now to "Play Now" button), where afterwards a generated ID for download2.php is generated, and a video player can be implemented and links to the generated ID e.g. download2.php?a=839Video.mp4&b=75e216be623ac45ffbc88f8332da9060 which should play the requested video.

Nevertheless, I am unsure whether or not you'll have to change the Content-type from application/octetstream to the appropriate content type.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm


Return to Daddy's File Host v1.X

Who is online

Users browsing this forum: No registered users and 16 guests

cron