change or remove

Started on the old forum in September 2017 · view the original in the archive · old links redirect here

5 replies · 96 views · started 9 years ago · 1 min read

2 participants
something else Fellow · 2,296 posts #2
<?php
    $url = 'http://videodl.djmaza.click/storage/0717/Hawayein%20%20-%20Jab%20Harry%20Met%20Sejal%20-%20DJMaza.Life.mp4';
    $name = explode("/", $url);
    $name = str_replace('DJMaza.Life','Your  Site Name',$name[5]);
    $headers = get_headers($url,1);
    $fsize = $headers['Content-Length'];
    header('Content-Description: File Transfer');
    header('Content-Type: video/mp4');
    header('Content-Disposition: attachment; filename='.$name);
    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: '.$fsize);
    ob_clean();
    flush();
    readfile($url);
    exit;
?>

Make sure you remove the space before <?php (coding talks bbcode auto puts that there)

hon3y Junior · 42 posts #3

How to implement it ... It's works for single files or multiple

something else Fellow · 2,296 posts #4

Its for a single file at a time although you could easily put it on a for loop for multiple items to download at one time, how ever doing so will put your server under strain. To use it you will need to change the string: $url - depending on your site set up, this could be pulled from your database or could be passed through a link eg:

$url = $_GET['url'];

or maybe another way, it really depends on your site setup.

hon3y Junior · 42 posts #5

it's working dear ... I have put the .php file ..

http://full-mp4.in/dl/

I want to hide ext .php from file name to be display and I want to display latest file on top n rest on ..file latest uploaded display on top

on one page I want to display 15 files like autoindex type

hon3y Junior · 42 posts #6

help me my free hosting don't allow autoindex ..please help me please give me by I can show latest files on top n rest below ...

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close