• Hi all,

    I am developing a plugin for role based file download, for downloading the file i am using template_redirect hook. The problem i am facing is, i couldn’t push the file to the client using readfile() php function (even the small files). When i try to push the file it is giving me a file not found error [Error 6 (net::ERR_FILE_NOT_FOUND)] but if i tried to check the file using file_exists() function it shows the file is present(using the same path which i gave to readfile() function as a param).

    code:

    header(‘Content-Type: application/pdf’);
    header(“Content-Type: application/force-download”);
    header(‘Content-Disposition: attachment; filename=filename.pdf’);
    readfile(filepath);

    NOTE: I have tried many header options but still nothing happens

    Please help me to find where i am wrong..

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘file download using for a plugin’ is closed to new replies.