Welcome Guest, Not a member yet? Register   Sign In
Download helper

[eluser]The Casual Bot[/eluser]
hey everyone

any one used the download helper

i got it to work (sort of)

however the file once download wont work apart from one pdf

and csv files but at the beginning of the csv files its add a few characters

so im guessing this is why some of the other files arent working

any ideas

function downloadfile() {
    $name = $_POST['name'];
    $path ="/home/sites/mysite.co.uk/public_html/files/".$_POST['id']."/".$_POST['name'];
    $data = file_get_contents($path);
    force_download($name, $data);

[eluser]The Casual Bot[/eluser]
another point

is when useing

$data = "some text";
$name = test.txt

it seems to cut a few character of the text file so you end up with

some t


Theme © iAndrew 2016 - Forum software by © MyBB